Repository navigation
Explain what to do when a worker process dies - #2762
Open
ndbroadbent wants to merge 1 commit into
Open
ndbroadbent wants to merge 1 commit into
ndbroadbent wants to merge 1 commit into
Conversation
When a forked worker exits without reporting back (killed for running out of memory, or crashed in a native extension), Parallel raises `Parallel::DeadWorker` and Tapioca printed only its backtrace. Raise a `Tapioca::Error` instead, saying what usually kills a worker, where to look for a crash report, and that `--workers=1` runs the work in one process. On macOS with the pg gem loaded and `PGGSSENCMODE` unset, also suggest turning off libpq's GSSAPI encryption, which is the fix maintainers have pointed people to in Shopify#1555, Shopify#2241 and Shopify#2390. See Shopify#1566.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See #1566.
Motivation
When a forked worker exits without reporting back, Parallel raises
Parallel::DeadWorkerand Tapioca prints only that error's backtrace, which doesn't say what happened or what to try. (A worker that raises a Ruby exception sends it back, and the parent re-raises it, soDeadWorkermeans the process was killed or crashed.) The usual causes are running out of memory and a native extension crashing after the fork. On macOS with PostgreSQL the second is common enough that the advice to setPGGSSENCMODE=disablehas been given in #1555, #2241 and #2390.Implementation
Executor#run_in_parallelturnsParallel::DeadWorkerinto aTapioca::Error, whichexe/tapiocaprints without a backtrace:The last paragraph appears only on macOS, with the pg gem loaded and
PGGSSENCMODEunset. This covers the "at the very least" half of #1566; it doesn't recover the dead worker's own trace, which for a crash Ruby has already printed to stderr above the message.Tests
Two executor specs: a worker that kills itself gives the message, and the PostgreSQL paragraph appears only when the check says it applies.