# SC310: Readiness was not withdrawn

> SC310 (readiness was not withdrawn) means the readiness route still reported ready after SIGTERM, up to the deadline. Return 503 or stop listening on SIGTERM.

Source: https://shutdown.jscrate.dev/docs/codes/sc310
Last updated: 2026-09-23

`SC310` means the readiness route continued to report ready after `SIGTERM`.
A load balancer may keep sending traffic to an instance that is already
shutting down.

| | |
| --- | --- |
| Code | `SC310` (FAIL) |
| Stage | Draining traffic |
| CLI exit code | 1 |
| What it means | With `readinessWithdrawal` on, the readiness route kept returning its ready status after SIGTERM until the deadline. |
| Message | `Readiness was not withdrawn before the shutdown deadline` |
| First thing to check | On SIGTERM, make the readiness route return 503 (or stop listening) so load balancers stop sending traffic. |

## How do I withdraw readiness?

Set a draining flag as soon as the signal arrives and return a non-ready
status from the readiness route:

```js
let draining = false;

app.get("/health", (_request, response) => {
  response.sendStatus(draining ? 503 : 200);
});

process.on("SIGTERM", () => {
  draining = true;
  server.close();
});
```

Closing the listener also counts because the readiness connection is refused.
A timed-out readiness request does not count as withdrawal; it leaves the
traffic state unclear.

## How do I verify the fix?

The timeline should record `readiness withdrawn` soon after `signal sent`.
Test the route manually during a controlled drain and confirm it changes from
the ready status to `503` or another non-ready status.

If the application changes state but the test does not see it, check that
`readiness.path` points to the same route used by the platform.

## Related

- [Readiness and draining](https://shutdown.jscrate.dev/docs/guides/readiness-and-draining)
- [Enable readiness withdrawal](https://shutdown.jscrate.dev/docs/configuration#shutdown)
- [SC311: New request accepted](https://shutdown.jscrate.dev/docs/codes/sc311)
- [Kubernetes shutdown](https://shutdown.jscrate.dev/docs/guides/kubernetes)
