diff --git a/hasql-pool.cabal b/hasql-pool.cabal
--- a/hasql-pool.cabal
+++ b/hasql-pool.cabal
@@ -1,7 +1,7 @@
 cabal-version: 3.0
 
 name: hasql-pool
-version: 0.8.0.4
+version: 0.8.0.5
 
 category: Hasql, Database, PostgreSQL
 synopsis: Pool of connections for Hasql
diff --git a/library/Hasql/Pool.hs b/library/Hasql/Pool.hs
--- a/library/Hasql/Pool.hs
+++ b/library/Hasql/Pool.hs
@@ -73,7 +73,7 @@
 -- | Release all the idle connections in the pool, and mark the in-use connections
 -- to be released after use. Any connections acquired after the call will be
 -- freshly established.
--- 
+--
 -- The pool remains usable after this action.
 -- So you can use this function to reset the connections in the pool.
 -- Naturally, you can also use it to release the resources.
@@ -130,7 +130,11 @@
           return $ Left $ ConnectionUsageError connErr
         Right conn -> onConn reuseVar conn
     onConn reuseVar conn = do
-      sessRes <- Session.run sess conn
+      sessRes <-
+        catch (Session.run sess conn) $ \(err :: SomeException) -> do
+          atomically $ modifyTVar' poolCapacity succ
+          throw err
+
       case sessRes of
         Left err -> case err of
           Session.QueryError _ _ (Session.ClientError _) -> do
