Detect and replace dead worker processes#67
Merged
pattonw merged 1 commit intofunkelab:masterfrom Mar 17, 2026
Merged
Conversation
WorkerPool.reap_dead_workers checks process.is_alive() and removes exited workers. TaskWorkerPools.check_worker_health calls it each event loop iteration and spawns replacements. Without this, workers that die silently (e.g., SIGKILL, SystemExit, OOM) leave the server hanging forever since no error is queued and no blocks are returned. Includes a previously failing test.
pattonw
approved these changes
Mar 17, 2026
Collaborator
pattonw
left a comment
There was a problem hiding this comment.
Good solution to a class of errors that daisy did not handle.
I think this will further exacerbate issue #64 since we don't have any checks on increment_workers to limit the number of workers we start. But that is a separate issue that should have its own pull request.
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.
Discovered while diagnosing #66 and an investigating an OOMing worker (hence noticing #65)
WorkerPool.reap_dead_workers checks process.is_alive() and removes exited
workers. TaskWorkerPools.check_worker_health calls it each event loop
iteration and spawns replacements. Without this, workers that die silently
(e.g., SIGKILL, SystemExit, OOM) leave the server hanging forever since
no error is queued and no blocks are returned. Includes a previously
failing test.
LLM disclosure: while I diagnosed and debugged the root issue, LLMs were used to exclude other causes and draft fixes. But all code here has been human reviewed or created.