We are using hasql-pool in production and have been chasing down an error where it seems our connections get pulled but never returned to the pool. This leads to a state where all the attempts to run sessions just hang until they hit the connection-acquisition timeout.
I seem to have chased down at least one of these to a place where there was a transaction error in the session. The simple solution seems to be to add a catch around the session execution that returns the connection to the pool and propagates the exception in an appropriate manner.
We are using
hasql-pool
in production and have been chasing down an error where it seems our connections get pulled but never returned to the pool. This leads to a state where all the attempts to run sessions just hang until they hit the connection-acquisition timeout.I seem to have chased down at least one of these to a place where there was a transaction error in the session. The simple solution seems to be to add a catch around the session execution that returns the connection to the pool and propagates the exception in an appropriate manner.
I'll submit a PR shortly.