From 36e5aceb3c1cc4d677c75a11caf248cb98a8c4fa Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Wed, 22 Aug 2018 09:53:25 -0700 Subject: [PATCH] Serve 503 if server process is shutting down (#1293) --- .../OutOfProcessRequestHandler/forwardinghandler.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/AspNetCoreModuleV2/OutOfProcessRequestHandler/forwardinghandler.cpp b/src/AspNetCoreModuleV2/OutOfProcessRequestHandler/forwardinghandler.cpp index e06b15f805..881c6393ad 100644 --- a/src/AspNetCoreModuleV2/OutOfProcessRequestHandler/forwardinghandler.cpp +++ b/src/AspNetCoreModuleV2/OutOfProcessRequestHandler/forwardinghandler.cpp @@ -344,6 +344,10 @@ Failure: { pResponse->SetStatus(400, "Bad Request", 0, hr); } + else if (hr == E_APPLICATION_EXITING) + { + pResponse->SetStatus(503, "Service Unavailable", 0, S_OK, nullptr, TRUE); + } else if (fFailedToStartKestrel && !m_pApplication->QueryConfig()->QueryDisableStartUpErrorPage()) { HTTP_DATA_CHUNK DataChunk;