Skip to content

fix(ingester): break main loop when all workers exit unexpectedly - #2043

Merged
tales-aparecida merged 1 commit into
kernelci:mainfrom
tales-aparecida:worktree-effervescent-prism
Aug 5, 2026
Merged

fix(ingester): break main loop when all workers exit unexpectedly#2043
tales-aparecida merged 1 commit into
kernelci:mainfrom
tales-aparecida:worktree-effervescent-prism

Conversation

@tales-aparecida

@tales-aparecida tales-aparecida commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

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

@tales-aparecida
tales-aparecida marked this pull request as draft August 3, 2026 18:57
@tales-aparecida tales-aparecida linked an issue Aug 3, 2026 that may be closed by this pull request
@tales-aparecida
tales-aparecida force-pushed the worktree-effervescent-prism branch from 6e35b8c to 525ff94 Compare August 3, 2026 19:06
@tales-aparecida
tales-aparecida marked this pull request as ready for review August 3, 2026 19:08
@tales-aparecida
tales-aparecida force-pushed the worktree-effervescent-prism branch from 525ff94 to 26d606c Compare August 3, 2026 19:18
@tales-aparecida tales-aparecida changed the title kcidbng_ingester: Don't wait on dead workers fix(ingester): break main loop when all workers exit unexpectedly Aug 3, 2026
@tales-aparecida
tales-aparecida force-pushed the worktree-effervescent-prism branch from 26d606c to aac4c0d Compare August 3, 2026 19:30

@mentonin mentonin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
tales-aparecida force-pushed the worktree-effervescent-prism branch from aac4c0d to 3491c0b Compare August 5, 2026 03:16
@tales-aparecida

Copy link
Copy Markdown
Contributor Author

The rest of the feedback I agreed, and fixed.

@tales-aparecida
tales-aparecida added this pull request to the merge queue Aug 5, 2026
Merged via the queue into kernelci:main with commit 448ac9d Aug 5, 2026
7 checks passed
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.

ingester: http requests missing timeout

3 participants