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

Trap MemoryError, print a log message, and halt #174

Merged
merged 2 commits into from
Mar 20, 2017

Conversation

zerebubuth
Copy link
Member

MemoryError sometimes gets thrown when a very, very large message is put in a multiprocessing queue. This exception propagates up to the root of the thread and kills it, locking up the worker.

According to the Python docs, MemoryError isn't entirely safe to recover from, so instead this halts the whole process. It will be restarted by runit / systemd, and it might lose some work, but any lost jobs will be re-queued by SQS after a timeout.

MemoryError sometimes gets thrown when a very, very large message is put in a multiprocessing queue. This exception propagates up to the root of the thread and kills it, locking up the worker.

According to the Python docs, MemoryError isn't entirely safe to recover from, so instead this halts the whole process. It will be restarted by runit / systemd, and it might lose some work, but any lost jobs will be re-queued by SQS after a timeout.
@zerebubuth zerebubuth merged commit 8c819c8 into master Mar 20, 2017
@zerebubuth zerebubuth deleted the zerebubuth/trap-memory-error branch March 20, 2017 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants