diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,11 @@
+# 0.8.0.7
+
+Fix excessive connections during releases due to race conditions.
+
+# 0.8.0.5
+
+Fix connections not returning to the pool on exceptions.
+
 # 0.8.0.2
 
 Fixed Windows build.
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.6
+version: 0.8.0.7
 
 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
@@ -85,8 +85,9 @@
     newReuse <- newTVar True
     writeTVar poolReuse newReuse
     conns <- flushTQueue poolConnectionQueue
-    modifyTVar' poolCapacity (+ (length conns))
-    return $ forM_ conns Connection.release
+    return $ forM_ conns $ \conn -> do
+      Connection.release conn
+      atomically $ modifyTVar' poolCapacity succ
 
 -- | Use a connection from the pool to run a session and return the connection
 -- to the pool, when finished.
@@ -132,6 +133,7 @@
     onConn reuseVar conn = do
       sessRes <-
         catch (Session.run sess conn) $ \(err :: SomeException) -> do
+          Connection.release conn
           atomically $ modifyTVar' poolCapacity succ
           throw err
 
@@ -152,9 +154,9 @@
             reuse <- readTVar reuseVar
             if reuse
               then writeTQueue poolConnectionQueue conn $> return ()
-              else do
-                modifyTVar' poolCapacity succ
-                return $ Connection.release conn
+              else return $ do
+                Connection.release conn
+                atomically $ modifyTVar' poolCapacity succ
 
 -- | Union over all errors that 'use' can result in.
 data UsageError
