Skip to content

[FEATURE] opt-in flag to preserve drain-on-SIGTERM behaviour (v3.110.0+) #903

Description

@aodanxin

Is your feature request related to a problem? Please describe.

Prior to v3.110.0, agent-stack-k8s handled SIGTERM by draining gracefully. The agent waited for the current job to finish before disconnecting.

We've heard from our Buildkite contact that starting in v3.110.0, this behaviour changed. The agent now immediately cancels the running job on SIGTERM instead of draining.

This would cause issues for us.
We run Buildkite agents on Kubernetes with Karpenter using the WhenEmptyOrUnderutilized consolidation policy. When Karpenter identifies an underutilized node, it evicts pods via SIGTERM.
With the new v3.110.0+ behaviour, this causes running CI jobs to be cancelled rather than completing.

Describe the solution you'd like

Add an opt-in flag or config option to agent-stack-k8s to restore the previous drain-on-SIGTERM behaviour: when a job pod receives SIGTERM, the agent should attempt to finish the current job rather than cancelling it immediately.

Describe alternatives you've considered

N/A

Affiliation (optional)

Faire

Additional context

Conversation within our Buildkite Slack channel: https://faire-wholesale.slack.com/archives/C06HR118GSW/p1782334084676339.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions