Shutdown Check

Search documentation

Find a page or section

SC200: In-flight request did not finish

SC200 (in-flight request did not finish) means a request running at SIGTERM did not complete before the shutdown deadline. The causes and how to fix them.

SC200 means an active request was still open when the shutdown deadline ended. It did not complete and it did not fail; the connection stayed open.

CodeSC200 FAIL
StageIn-flight responses
CLI exit code1
What it meansA request that was running when SIGTERM arrived did not complete before the shutdown deadline.
Message
  • In-flight request #<n> did not finish within <shutdown.deadlineMs> ms
First thing to checkStop accepting connections with server.close() and let open requests finish; do not wait on keep-alive sockets or timers that never end.

Why does a request hang?

  • The shutdown handler waits for the request, but the request waits for shutdown cleanup.
  • A database call, upstream request, or lock never finishes.
  • The server stops reading or writing without closing the response.
  • shutdown.deadlineMs is shorter than the expected operation.
  • A timer or stream is left open.

How do I fix it?

  1. Add logs around the slow handler and each shutdown step.
  2. Let active handlers finish before closing their dependencies.
  3. Put timeouts on network, database, and queue operations.
  4. Set deadlineMs above the slowest valid request, but below the platform's termination limit.

Do not call process.exit() to clear this code. That cuts the connection and turns the failure into SC201.

How do I verify the fix?

The timeline should show work request finished before the deadline. Add bodyIncludes when a normal-looking response could still hide incomplete work.

Test with the slowest valid operation, not only a fixed sleep. If external systems can stall, verify their own timeout path as a separate failure test.