Skip to content

fix: terminationGracePeriodSeconds now includes grace_shutdown_post_delay_seconds - #548

Open
jiuker wants to merge 2 commits into
apache:masterfrom
jiuker:fix/issue-535-termination-grace-period
Open

jiuker wants to merge 2 commits into
apache:masterfrom
jiuker:fix/issue-535-termination-grace-period

Conversation

@jiuker

@jiuker jiuker commented Nov 13, 2026 •

Copy link
Copy Markdown

Closes #535

Summary

Fixes Apache Doris Operator issue #535 where the BE pod's terminationGracePeriodSeconds was set to only grace_shutdown_wait_seconds, ignoring grace_shutdown_post_delay_seconds (default 30s). This causes kubelet to SIGKILL the BE process during the post-stop delay period.

Changes

  • Added GRACE_SHUTDOWN_POST_DELAY_SECONDS config key constant
  • Added DefaultPostDelaySeconds variable (default 30s from Apache Doris)
  • Modified GetTerminationGracePeriodSeconds() to return waitSeconds + DefaultPostDelaySeconds
  • Updated tests to reflect new default behavior

Behavior Change

Scenario Before After
No config 200s (recycle) 30s (auto includes post-delay)
wait=120 only 120s 150s (120+30)
post_delay=60 explicit Ignored wait + 60

How It Works

The operator now reads both grace_shutdown_wait_seconds and grace_shutdown_post_delay_seconds from be.conf and returns their sum as terminationGracePeriodSeconds, ensuring the Kubernetes pod has enough grace period for the full BE graceful shutdown process.

…elay_seconds

Closes apache#535

The operator sets the BE pod's terminationGracePeriodSeconds to exactly
grace_shutdown_wait_seconds from be.conf. But the BE's graceful stop takes up to
grace_shutdown_wait_seconds + grace_shutdown_post_delay_seconds.

grace_shutdown_post_delay_seconds defaults to 30s, which ensures fragments of
the same query on other BEs can finish before this BE disappears.

Previously the operator only read grace_shutdown_wait_seconds, so the gap
exactly remained grace_shutdown_post_delay_seconds.

Now the operator reads both values and returns their sum, so the termination
grace period covers the BE's whole graceful stop.
@jiuker jiuker closed this Nov 13, 2026
@jiuker jiuker reopened this Nov 13, 2026
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.

BE terminationGracePeriodSeconds = grace_shutdown_wait_seconds ignores grace_shutdown_post_delay_seconds, so a full graceful drain is SIGKILLed

1 participant