Shutdown Check

Search documentation

Find a page or section

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.

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.

CodeSC311 FAIL
StageDraining traffic
CLI exit code1
What it meansA 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 checkReject 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.

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.