Add terminationGracePeriodSeconds support for PgBouncer in Helm chart - #71237
Open
antruigon wants to merge 1 commit into
Open
Add terminationGracePeriodSeconds support for PgBouncer in Helm chart#71237antruigon wants to merge 1 commit into
antruigon wants to merge 1 commit into
Conversation
antruigon
requested review from
Miretpl,
bugraoz93,
hussein-awala,
jedcunningham and
jscheffl
as code owners
August 6, 2026 12:07
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
|
Miretpl
requested changes
Aug 13, 2026
Contributor
|
Could you please match the PR description with the project template and follow https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions? |
The chart ships a default PgBouncer preStop hook that drains client connections for up to 120 seconds, but the Deployment never sets terminationGracePeriodSeconds, so the Kubernetes default of 30s SIGKILLs the pod mid-drain on a node drain or eviction and cuts in-flight client connections. Every other long-running component in the chart already exposes this value; PgBouncer was the only one missing it, despite being the component that holds the database connections of all the others. The default of 120 matches the drain window of the default preStop hook. PgBouncer exits as soon as the last client connection is released, so the value is an upper bound rather than a fixed wait.
antruigon
force-pushed
the
add-pgbouncer-termination-grace-period
branch
from
August 18, 2026 10:33
89ef4d3 to
f828912
Compare
Author
|
Done, sorry for the miss. The description now follows the project template and includes the Gen-AI disclosure. The change was AI-assisted and reviewed by me. I validated the rendered chart and ran the helm tests locally (test_pgbouncer.py, test_pdb_pgbouncer.py, test_chart_quality.py) before pushing |
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 chart ships a default PgBouncer preStop hook that drains client connections for up to 120 seconds (
killall -INT pgbouncer && sleep 120), but the Deployment never setsterminationGracePeriodSeconds, so the Kubernetes default of 30s SIGKILLs the pod mid-drain on a node drain or eviction and cuts in-flight client connections.Every other long-running component in the chart (scheduler, workers, triggerer, dag-processor, statsd, redis, otel collector) already exposes this value; PgBouncer was the only one missing it, despite holding the database connections of all the others.
This adds
pgbouncer.terminationGracePeriodSeconds, defaulting to 120 to match the preStop drain window. PgBouncer exits as soon as the last client connection is released, so the value is an upper bound rather than a fixed wait. Deployments that prefer the previous behaviour can set it back to 30.Covered by a parametrized test in
test_pgbouncer.py(default and override).Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Claude Fable 5) following the guidelines