Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update and reload stop working after processing invalid files #6

Open
jumpifnotzero opened this issue May 17, 2023 · 1 comment
Open
Labels
question Further information is requested

Comments

@jumpifnotzero
Copy link
Collaborator

The update/reload scripts stops when encountering a file with invalid json, or invalid rdap-json.
Fixing the error and touching update/reload does not appear to trigger a second update/reload.

What I would like to see is for update to log an error to the logs and skip the file. This means there would be one error for every problematic file. Recovery from this state requires fixing the broken files and doing a seccon 'update'.

For reload however the semantics are different. I would still want to see an error in the logs, howevear given the ambiguity of whether you have complete state, reload would instead skip the removal of data not backed by files. In effect it would behave like update. Again, fixing the error in the file and running reload would trigger the expected reload.

@anewton1998
Copy link
Collaborator

I'd prefer to try and prevent the problem. I was thinking of a quick little utility that would check the files before moving them in the state directory. Especially since at the moment the checks are purely about key sanity and JSON validity, but there are other checks that could be done.

Thinking out loud here:

## Places piped file in state dir if it looks good, otherwise errors out
cat foo.json > rdap-srv-mem-put

or

## just move the file if it is valid, otherwise error
rdap-srv-mem-put --file foo.json

or

## move all files in dir
rdap-srv-mem-put --dir my-new-files.d/

The disadvantage of option 1 is that it has to be given a file name via cli opts or just create one. But depending on the script, it might be easier to use.

@anewton1998 anewton1998 added the question Further information is requested label Jun 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants