-
-
Notifications
You must be signed in to change notification settings - Fork 345
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
Aborting a ckan scan
halfway through leaves a corrupt registry.json file
#2754
Comments
We've already got a file system transaction library, maybe we can use that? EDIT: We already do! CKAN/Core/Registry/RegistryManager.cs Lines 413 to 455 in f2209e2
That raises some questions. Does the transaction not work? Are we using it wrong? EDIT II: The scan operation has a transaction, but the Save call takes place outside of (after) it. That looks like a bad idea. Lines 409 to 445 in f2209e2
|
Think this is related to or possibly a spiritual-duplicate of #1114
I don't really want to recreate the issue at this point and I've since repaired my installation, but the use case was simple, which was to do
ckan scan
on the commandline and then ctrl-c it halfway through it. I actually had typed something likeckan scan Proc
when I meantckan search Proc
so I just quickly ctrl-c'd it to fix the typo.What resulted was a registry.json which was clearly half-written and truncated, and any subsequent ckan command was throwing JSON parsing errors. Doing a
ckan repair registry
didn't help any.It's probably a simple case of where the routines that write out JSON files need to write to a tempfile first, then close the filehandle, then move/rename the file into place.
The text was updated successfully, but these errors were encountered: