# SC202: In-flight request got the wrong status

> SC202 (in-flight request got the wrong status) means a request running at SIGTERM finished with a status other than workload.status. Find what changed it.

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

`SC202` means an active request finished, but its HTTP status did not match
`workload.status`. The connection drained, yet the response changed during
shutdown or the config expects the wrong status.

| | |
| --- | --- |
| Code | `SC202` (FAIL) |
| Stage | In-flight responses |
| CLI exit code | 1 |
| What it means | A request that was running when SIGTERM arrived finished, but with a different HTTP status than `workload.status`. |
| Message | `In-flight request returned HTTP <status>; expected <workload.status>` |
| First thing to check | Let requests already in progress finish normally; reject only new work during shutdown. |

## What should I check?

- Run the workload without shutdown and record its normal status.
- Confirm that `workload.status` matches that response.
- Check whether shutdown middleware returns `503` for every request.
- Make sure only **new** work is rejected during the drain.
- With a probe barrier, check errors that occur after the work starts.

```json title="shutdown-check.json"
{
  "workload": {
    "path": "/slow",
    "status": 200,
    "started": { "type": "response-headers" }
  }
}
```

Do not change the expected status merely to make the test pass. It should
describe the response a successful request returns during normal operation.

## How do I verify the fix?

Run the workload without a shutdown and during a shutdown. Both responses
should use the same success status when the request began before `SIGTERM`.

New requests may correctly receive `503`; the distinction is when they enter
the application. Log the draining state at request start if middleware order
is unclear.

## Related

- [Workload configuration](https://shutdown.jscrate.dev/docs/configuration#workload)
- [Reject only new traffic](https://shutdown.jscrate.dev/docs/guides/readiness-and-draining)
- [SC201: Request interrupted](https://shutdown.jscrate.dev/docs/codes/sc201)
- [SC203: Wrong response body](https://shutdown.jscrate.dev/docs/codes/sc203)
