Open jtniehof opened 3 years ago
This would be really good. What cleaning do you end up doing? I typically just use the clear processing flag script.
Sometimes I'll wind up with the file in the incoming directory and I have to poke around in the database to see if it was ingested and/or added to the processing queue, that sort of thing. Some of this is just going to be homework and documentation: "if the processing is killed this is what you have to do to get going again."
Incidentally on a true crash I very much appreciate having the processing flag set since I have this kicked off automatically, so if something crashes out it's good to not have it start back up!
kill
-ing ProcessQueue (i.e. sending SIGTERM) is pretty messy, it just dies directly. It would be nice to have a SIGTERM handler that does a minimal amount of cleanup and leaves the database in a defined state without the currently-processing flag set.Proposed enhancement
SIGTERM handler that at a minimum:
Alternatives
This is already pretty vague; do-nothing is always an alternative but I always spend a bunch of time hand-cleaning the state if I have to kill a ProcessQueue.
OS, Python version, and dependency version information:
Version of dbprocessing
git master (8e5d3ae432fb35227c74bc5615422cf456b39578)
Closure condition
This issue should be closed when: design finalized and PR merged with both the handler and appropriate documentation for how to recover.