fix(ingester): break main loop when all workers exit unexpectedly - #2043
Merged
tales-aparecida merged 1 commit intoAug 5, 2026
Merged
Conversation
tales-aparecida
marked this pull request as draft
August 3, 2026 18:57
tales-aparecida
force-pushed
the
worktree-effervescent-prism
branch
from
August 3, 2026 19:06
6e35b8c to
525ff94
Compare
tales-aparecida
marked this pull request as ready for review
August 3, 2026 19:08
tales-aparecida
force-pushed
the
worktree-effervescent-prism
branch
from
August 3, 2026 19:18
525ff94 to
26d606c
Compare
tales-aparecida
force-pushed
the
worktree-effervescent-prism
branch
from
August 3, 2026 19:30
26d606c to
aac4c0d
Compare
mentonin
reviewed
Aug 4, 2026
mentonin
left a comment
Contributor
There was a problem hiding this comment.
commit message says alive checks run "after each progress report", but they run every loop instead
Also, commit message claims this fixes #2041 and deals with hanging, but this fix does neither - it deals with all workers dying (not hanging) before the queue is dealt with, and hanging workers still block forever (#2041 only fixes workers hanging on http requests). We can go ahead with the merge, but live workers hanging might come back as an issue later
The main loop waited for the queue to drain (while not process_queue.empty()), which blocks forever when all workers die without consuming their poison pills. Now the loop checks on every iteration whether any worker is still alive and breaks with an error log if all workers have exited while items remain in the queue. This is the second part of the fix for kernelci#2041: PR kernelci#2042 adds request timeouts to prevent workers from hanging indefinitely, and this PR detects the case where workers exit without draining the queue. After joining, non-zero exit codes are logged and a Prometheus counter (kcidb_ingester_worker_failures) is incremented with reason="exception" or reason="signal". The reason label is more actionable for alerting (e.g. rate(worker_failures{reason="signal"}) > 0 catches OOM kills) while the exact exit code in the log line provides detail for debugging. Also adds docs/ingester.md documenting the parallel ingestion architecture, worker-queue protocol, and error handling. Related: kernelci#2041 Assisted-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Tales da Aparecida <tales.aparecida@redhat.com>
tales-aparecida
force-pushed
the
worktree-effervescent-prism
branch
from
August 5, 2026 03:16
aac4c0d to
3491c0b
Compare
Contributor
Author
|
The rest of the feedback I agreed, and fixed. |
mentonin
approved these changes
Aug 5, 2026
felipebergamin
approved these changes
Aug 5, 2026
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.
The main loop waited for the queue to drain (while not
process_queue.empty()), which blocks forever when a worker hangs and
never consumes its poison pill. Now the loop checks whether any worker
is still alive after each progress report and breaks with an error log
if all workers have exited while items remain in the queue.
After joining, non-zero exit codes are logged and a Prometheus counter
(kcidb_ingester_worker_failures) is incremented with reason="exception"
or reason="signal". The reason label is more actionable for alerting
(e.g. rate(worker_failures{reason="signal"}) > 0 catches OOM kills)
while the exact exit code in the log line provides detail for
debugging.
Also adds docs/ingester.md documenting the parallel ingestion
architecture, worker-queue protocol, and error handling.
Fixes: #2041
Depends on #2042
Assisted-by: Claude Opus 4.6 noreply@anthropic.com
Signed-off-by: Tales da Aparecida tales.aparecida@redhat.com