{"version":"2.1.275","anchor":"new-self-hosted-runner-drain-grace-self-hosted-runner-post","canonical_anchor":"new-self-hosted-runner-drain-grace-self-hosted-runner-post","heading":"New self-hosted-runner drain grace: SELF_HOSTED_RUNNER_POST_TURN_SETTLE_MS","tier":"use","area":"Self-Hosted Runner","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.275\/e\/new-self-hosted-runner-drain-grace-self-hosted-runner-post","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.275","markdown":"### New self-hosted-runner drain grace: SELF_HOSTED_RUNNER_POST_TURN_SETTLE_MS\n\nSelf-hosted runners now wait briefly after a turn finishes before shutting down, so results aren't lost\n\n**What**\n\nWhen a self-hosted runner is told to drain (stop accepting new work and shut down), it now treats a turn that just finished as still \"in flight\" for a short grace period, until the session process confirms to the server that the turn has actually ended. This period is controlled by a new environment variable, `SELF_HOSTED_RUNNER_POST_TURN_SETTLE_MS`, which defaults to about 2 seconds. The runner's startup log now reports this setting as `post-turn-settle`.\n\n**Why**\n\nWithout this grace period, a runner shutting down (via `SIGTERM`, the signal used to stop a process) right after a turn appears complete could lose that turn's result before it was fully reported. This change closes that small window so results aren't silently dropped during a drain.\n\n- Area: Self-Hosted Runner\n- Tier: Use it now\n- Useful: 3\/5\n- Signal: 1\/5"}