Add terminationGracePeriodSeconds support for PgBouncer in Helm chart - #71237
Conversation
|
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
|
|
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.
89ef4d3 to
f828912
Compare
|
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 |
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
Backport successfully created: chart/v1-2x-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
…uncer in Helm chart (#71237) (#71787) 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. (cherry picked from commit 0815a27) Co-authored-by: antruigon <99184149+antruigon@users.noreply.github.com> Co-authored-by: Przemysław Mirowski <17602603+Miretpl@users.noreply.github.com>
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