nikita-volkov / hasql-pool

A pool of connections for Hasql
http://hackage.haskell.org/package/hasql-pool
MIT License
17 stars 15 forks source link

Failed connection attempts should be removed from pool #1

Closed bergey closed 5 years ago

bergey commented 6 years ago

hasql-pool keeps the results of failed connection attempts in the pool, and offers them to subsequent queries. In consequence, transient connection failures at program start poison the pool, and all future attempts at running SQL fail.

If I understand correctly, resource-pool expects create to return a valid resource or throw an exception. If create or subsequent actions using the resource throw an exception, resource-pool removes the resource from the pool, making room for a new connection.

hasql-pool encodes connection failures as Left, which remain in the pool, and are never replaced by actual connections.

domenkozar commented 5 years ago

FYI: this was solved in https://github.com/nikita-volkov/hasql-pool/pull/3/files and then re-implemented in further commits. Released in 0.5.0.1

nikita-volkov commented 5 years ago

Somehow missed the issue. Thanks for reporting and responding guys!