possible resource leak, connection not always actively destroyed
robx opened this issue · comments
Robert commented
We create libpq connections with initPQConn
:
-
Then if we're not happy with the connection (or something goes wrong figuring that out), we throw it away, leaving the call to PQfinish to the foreign pointer finalizer.
-
In the pool initializer:
pg-client-hs/src/Database/PG/Query/Pool.hs
Line 115 in 5e8a2d7
initPQConn
will again not be finalized if something goes wrong later in the creator (e.g. exception thrown byEKG.Distribution.Add
).