File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,6 +19,10 @@ All notable changes to this project will be documented in this file. From versio
1919- Log error when ` db-schemas ` config contains schema ` pg_catalog ` or ` information_schema ` by @taimoorzaeem in #4359
2020 + Now fails at startup. Prior to this, it failed with ` PGRST205 ` on requests related to these schemas.
2121
22+ ### Fixed
23+
24+ - Shutdown should wait for in flight requests by @mkleczek in #4702
25+
2226## [ 14.6] - 2026-03-06
2327
2428### Fixed
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import GHC.IO.Exception (IOErrorType (..))
2222import System.IO.Error (ioeGetErrorType )
2323
2424import Control.Monad.Except (liftEither )
25+ import Control.Monad.Extra (whenJust )
2526import Data.Either.Combinators (mapLeft , whenLeft )
2627import Data.Maybe (fromJust )
2728import Data.String (IsString (.. ))
@@ -78,8 +79,10 @@ run appState = do
7879
7980 AppState. schemaCacheLoader appState -- Loads the initial SchemaCache
8081 (mainSocket, adminSocket) <- initSockets conf
81-
82- Unix. installSignalHandlers (AppState. getMainThreadId appState) (AppState. schemaCacheLoader appState) (AppState. readInDbConfig False appState)
82+ let closeSockets = do
83+ whenJust adminSocket NS. close
84+ NS. close mainSocket
85+ Unix. installSignalHandlers closeSockets (AppState. schemaCacheLoader appState) (AppState. readInDbConfig False appState)
8386
8487 Listener. runListener appState
8588
Original file line number Diff line number Diff line change @@ -18,10 +18,9 @@ import System.Directory (removeFile)
1818import System.IO.Error (isDoesNotExistError )
1919
2020-- | Set signal handlers, only for systems with signals
21- installSignalHandlers :: ThreadId -> IO () -> IO () -> IO ()
21+ installSignalHandlers :: IO () -> IO () -> IO () -> IO ()
2222#ifndef mingw32_HOST_OS
23- installSignalHandlers tid usr1 usr2 = do
24- let interrupt = throwTo tid UserInterrupt
23+ installSignalHandlers interrupt usr1 usr2 = do
2524 install Signals. sigINT interrupt
2625 install Signals. sigTERM interrupt
2726 install Signals. sigUSR1 usr1
Original file line number Diff line number Diff line change @@ -105,7 +105,6 @@ def sleep():
105105 t .join ()
106106
107107
108- @pytest .mark .xfail (reason = "Graceful shutdown is currently failing" )
109108def test_graceful_shutdown_waits_for_in_flight_request (defaultenv ):
110109 "SIGTERM should allow in-flight requests to finish before exiting"
111110
You can’t perform that action at this time.
0 commit comments