Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend default signal grace period to 9 seconds #2696

Merged
merged 2 commits into from Mar 20, 2024

Conversation

triarius
Copy link
Contributor

@triarius triarius commented Mar 20, 2024

Description

When a job is cancelled, the agent sends a SIGTERM to the bootstrap process of the job. This immediately sends a SIGTERM1 to child processes of the bootstrap process. After the signal-grace-period, a SIGKILL is sent to these child processes and the bootstrap process exits. Currently, the signal-grace-period, though configurable, defaulted to 0s. This was done to simulate the previous behaviour where a SIGKILL was sent immediately. This PR changes the default to 9s. This value was chosen because it is the largest integer less than 10, which is the default value of the cancel-grace-period. That is the time the bootstrap process has to exit before it is itself sent a SIGKILL by the agent worker process.

Context

#2250
#2654

Changes

  • signal-grace-period-seconds is now 9 by default.
  • a more helpful error message when the assertion signal-grace-period-seconds < cancel-grace-period fails.

Testing

  • Tests have run locally (with go test ./...). Buildkite employees may check this if the pipeline has run automatically.
  • Code is formatted (with go fmt ./...)

Footnotes

  1. It's SIGTERM by default but that's configurable.

@triarius triarius requested a review from a team March 20, 2024 03:57
@triarius triarius merged commit 7fe8b54 into main Mar 20, 2024
1 check passed
@triarius triarius deleted the triarius/signal-grace-period-seconds-9 branch March 20, 2024 04:58
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.

None yet

2 participants