Repository navigation
[PR #8216/ad596660 backport][3.118] fix(content): exit on database failures - #8228
Merged
ggainey merged 1 commit intoOct 15, 2026
Conversation
Terminate content workers when database registration or heartbeat writes fail, so a detached heartbeat task cannot leave the worker serving without an AppStatus heartbeat. (cherry picked from commit ad59666)
ggainey
approved these changes
Oct 15, 2026
ggainey
enabled auto-merge (rebase)
October 15, 2026 18:44
ggainey
deleted the
patchback/backports/3.118/ad5966607e0f826c090885d938729bf7cfac94fd/pr-8216
branch
October 15, 2026 19:27
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.
This is a backport of PR #8216 as merged into main (ad59666).
Problem
Content workers can lose database connectivity during PostgreSQL outage. content endpoint can continue returning HTTP 200 while Pulp removes worker's
AppStatusheartbeat entry. operator seesonline_content_apps: []Hub readiness never completes.Root Cause
heartbeat runs in detached asyncio task. previous failure path called:
In deployed aiohttp/Gunicorn worker, did not terminate worker process. HTTP server continued serving
/pulp/content/, so Pod remained Ready Kubernetes did not restart it.Changes
os._exit(Arbiter.WORKER_BOOT_ERROR)when initial content-app registration fails, including duplicate registration and other database failures.os._exit(Arbiter.WORKER_BOOT_ERROR)when a heartbeat write fails after the existing connection reset and second write attempt.CONTENT_APP_MAX_DB_RETRIESsetting.os._exit, injects cleanup failure, and verifies the worker exits with the Gunicorn boot-error code.worker now fails closed. Kubernetes restarts container. If PostgreSQL still unavailable, replacement process exits again; once PostgreSQL recovers, next replacement registers heartbeat normally. No registration retry loop required.
Validation
change tested against original unpatched Galaxy image using pre-PR #302 operator:
HaltServer('Worker failed boot.', 3).online_content_appsentries returned.Focused heartbeat tests cover both registration error types, heartbeat write failures, and process-boundary termination. Ruff, Black, Python compilation, and diff checks also pass.
PR #302 remains possible operator-side mitigation already-running images contain Pulpcore defect, but change fixes failure content-worker level.