Extend default signal grace period to 9 seconds #2696
Merged
+6
−4
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.
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.signal-grace-period-seconds < cancel-grace-period
fails.Testing
go test ./...
). Buildkite employees may check this if the pipeline has run automatically.go fmt ./...
)Footnotes
It's SIGTERM by default but that's configurable. ↩