Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions persistent/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog for persistent

# 2.18.1.1
* [#1637](https://github.com/yesodweb/persistent/pull/1637)
* Fixes interruptible logging on connection closing inside `createSqlPoolWithConfig` since `resource-pool-0.5.x`.

# 2.18.1.0
* [#1616](https://github.com/yesodweb/persistent/pull/1616)
* Allow overriding the default cascade option for foreign keys.
Expand Down
15 changes: 8 additions & 7 deletions persistent/Database/Persist/Sql/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -280,16 +280,17 @@ createSqlPoolWithConfig
-> m (Pool backend)
createSqlPoolWithConfig mkConn config = do
logFunc <- askLoggerIO
-- Resource pool will swallow any exceptions from close. We want to log
-- them instead.
-- NOTE: resource-pool >= 0.5 no longer runs the pool's free action
-- uninterruptibly, and no longer swallows its exceptions.
let
loggedClose :: backend -> IO ()
loggedClose backend =
close' backend `UE.catchAny` \e -> do
runLoggingT
(logError $ T.pack $ "Error closing database connection in pool: " ++ show e)
logFunc
UE.throwIO e
UE.uninterruptibleMask_ $
close' backend `UE.catchAny` \e -> do
runLoggingT
(logError $ T.pack $ "Error closing database connection in pool: " ++ show e)
logFunc
UE.throwIO e
liftIO $
createPool
(mkConn logFunc)
Expand Down
2 changes: 1 addition & 1 deletion persistent/persistent.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: persistent
version: 2.18.1.0
version: 2.18.1.1
license: MIT
license-file: LICENSE
author: Michael Snoyman <michael@snoyman.com>
Expand Down