{"version":"2.1.238","anchor":"self-hosted-runner-can-defer-its-drain-on-the-first-shutdown","canonical_anchor":"self-hosted-runner-can-defer-its-drain-on-the-first-shutdown","heading":"Self-hosted runner can defer its drain on the first shutdown signal","tier":"use","area":"Self-Hosted Runner","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.238\/e\/self-hosted-runner-can-defer-its-drain-on-the-first-shutdown","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.238","markdown":"### Self-hosted runner can defer its drain on the first shutdown signal\n\nSelf-hosted runners can keep serving attached sessions on the first shutdown signal instead of draining.\n\n**What**\n\nNew flag `--defer-shutdown-max-min <m>` makes the first SIGTERM stop the runner accepting new work while it keeps serving attached sessions, rather than starting the drain budget straight away. It writes `SELF_HOSTED_RUNNER_DEFER_SHUTDOWN_MAX_MS`; 0 disables it and is the default, so operators who do not pass the flag see no change.\n\n**Details**\n\n- After M minutes everything still attached is released through the park path; a further grace period later it drains as a last resort. It exits 0 as soon as no session is held.\n- A second signal drains immediately; a third force-exits.\n- Help text warns that the supervisor's stop timeout must exceed M minutes plus the grace plus the shutdown budget, and the troubleshooting table gained a row for the new exit line.\n- New telemetry points `self_hosted_defer_shutdown` and `self_hosted_defer_ceiling`; poll-failure backoff now distinguishes timeout and transport errors from 5xx responses.\n\n**Usage**\n\n`claude self-hosted-runner --defer-shutdown-max-min 30` **Evidence** `--defer-shutdown-max-min`, `--defer-shutdown-max-min <m>`\n\n- Area: Self-Hosted Runner\n- Names: `--defer-shutdown-max-min`, `SELF_HOSTED_RUNNER_DEFER_SHUTDOWN_MAX_MS`\n- Tier: Use it now\n- Useful: 2\/5\n- Signal: 2\/5"}