Skip to content

Commit 36e5ace

Browse files
authored
Serve 503 if server process is shutting down (#1293)
1 parent e26231b commit 36e5ace

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/AspNetCoreModuleV2/OutOfProcessRequestHandler/forwardinghandler.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,10 @@ FORWARDING_HANDLER::OnExecuteRequestHandler()
344344
{
345345
pResponse->SetStatus(400, "Bad Request", 0, hr);
346346
}
347+
else if (hr == E_APPLICATION_EXITING)
348+
{
349+
pResponse->SetStatus(503, "Service Unavailable", 0, S_OK, nullptr, TRUE);
350+
}
347351
else if (fFailedToStartKestrel && !m_pApplication->QueryConfig()->QueryDisableStartUpErrorPage())
348352
{
349353
HTTP_DATA_CHUNK DataChunk;

0 commit comments

Comments
 (0)