# SC311: New request was accepted during drain

> SC311 (new request was accepted during drain) means a new request sent after readiness was withdrawn was not rejected. Return 503 or stop listening.

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

`SC311` means the service accepted new work after readiness was withdrawn and
while an older request was still draining. That new work may be cut off when
the process exits.

| | |
| --- | --- |
| Code | `SC311` (FAIL) |
| Stage | Draining traffic |
| CLI exit code | 1 |
| What it means | A new request sent after readiness was withdrawn got a normal response instead of being rejected. |
| Message | `New request was not rejected during drain: <status>` |
| First thing to check | Reject new work during shutdown with a status in `rejectStatuses` (503 by default), or stop accepting connections. |

## How should the service reject new work?

Choose one behavior:

- Keep listening during a short drain window and return `503` for new work.
- Close the listener and allow the connection to be refused.

Then make `newRequests.rejectStatuses` and
`newRequests.allowConnectionRefused` match that choice.

```json title="shutdown-check.json"
{
  "shutdown": {
    "readinessWithdrawal": true,
    "newRequests": {
      "path": "/test/new-work",
      "rejectStatuses": [503],
      "allowConnectionRefused": true
    }
  }
}
```

A timeout is not a rejection. The service must return a configured status or
clearly refuse the connection.

## How do I verify the fix?

The timeline should show `new request rejected — HTTP 503` or a refused
connection after `readiness withdrawn` and before the original request
finishes.

Keep the rejection route safe and representative. A special route that always
returns `503` can make the test pass without proving that real new work is
blocked.

## Related

- [Drain new traffic safely](https://shutdown.jscrate.dev/docs/guides/readiness-and-draining)
- [Configure `newRequests`](https://shutdown.jscrate.dev/docs/configuration#shutdown)
- [SC310: Readiness not withdrawn](https://shutdown.jscrate.dev/docs/codes/sc310)
- [SC312: Work finished before the rejection test](https://shutdown.jscrate.dev/docs/codes/sc312)
