{"version":"2.1.302","anchor":"worker-lease-release-can-report-drained","canonical_anchor":"worker-lease-release-can-report-drained","heading":"Releasing a remote-control worker lease can now say the worker drained","tier":"internal","area":"Sessions","scope":"both","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.302\/e\/worker-lease-release-can-report-drained","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.302","markdown":"### Releasing a remote-control worker lease can now say the worker drained\n\n`closeForSuccessor` and `goodbye` accept a `drained` option that `releaseLease` sends as `drained: true` when handing a session off\n\n**What**\n\nIn remote control, a worker holds a lease, a claim on a session, and releases it when it hands the session to a successor. That release can now say whether the worker drained, meaning it finished its outstanding work.\n\n- `closeForSuccessor` and `goodbye` accept a `drained` option, false by default.\n\n- `closeForSuccessor` passes it on to `releaseLease({ drained })`.\n\n- `releaseLease` sends `drained: true` in the release request to `\/worker\/heartbeat`. Before, the request sent only `release_lease`.\n\n**Why**\n\nThe server can now tell a worker that finished its work before handing off apart from one released for other reasons, which can affect how the session handoff goes.\n\n- Area: Sessions\n- Tier: Under the hood\n- Useful: 1\/5\n- Signal: 3\/5\n- Scope: both\n- Heads-up: no"}