fix: misleading logs on unsupported postgresql versions

Postgrest fails on unsupported pg versions. However before killing
the thread, it continues to print a few more log messages which
were misleading. This commit fixes this by making sure that the
no log message should be printed after the unsupported pg version
observation and kill the thread immediately.

Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
This commit is contained in:
Taimoor Zaeem
2025-12-09 13:46:34 -05:00
committed by Steve Chavez
parent 24a27d17d0
commit 0fa2f569a7
2 changed files with 12 additions and 6 deletions
+4
View File
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. From versio
## Unreleased ## Unreleased
### Fixed
- Fix misleading logs on unsupported PostgreSQL versions by @taimoorzaeem in #4519
## [14.1] - 2025-11-05 ## [14.1] - 2025-11-05
## Fixed ## Fixed
+8 -6
View File
@@ -382,14 +382,16 @@ retryingSchemaCacheLoad appState@AppState{stateObserver=observer, stateMainThrea
observer ExitDBNoRecoveryObs observer ExitDBNoRecoveryObs
killThread mainThreadId killThread mainThreadId
return Nothing return Nothing
Right actualPgVersion -> do Right actualPgVersion ->
when (actualPgVersion < minimumPgVersion) $ do if actualPgVersion < minimumPgVersion then do
observer $ ExitUnsupportedPgVersion actualPgVersion minimumPgVersion observer $ ExitUnsupportedPgVersion actualPgVersion minimumPgVersion
killThread mainThreadId killThread mainThreadId
observer $ DBConnectedObs $ pgvFullName actualPgVersion return Nothing
observer $ PoolInit configDbPoolSize else do
putPgVersion appState actualPgVersion observer $ DBConnectedObs $ pgvFullName actualPgVersion
return $ Just actualPgVersion observer $ PoolInit configDbPoolSize
putPgVersion appState actualPgVersion
return $ Just actualPgVersion
qInDbConfig :: IO () qInDbConfig :: IO ()
qInDbConfig = do qInDbConfig = do