Upgrade hasql-pool
Preparatory work for #2348, as discussed with @steve-chavez.
This loses the db-pool-timeout config option (and timing out of idle connections at all), and fixes #2401.
@steve-chavez I believe I've addressed the review comments, could you have another look?
Q: With the new flushPool, do see any performance impact in comparison to the old releasePool?
Q: With the new
flushPool, do see any performance impact in comparison to the oldreleasePool?
I don't expect a meaningful performance impact for flushPool. The extra cost should be just looking up an IORef.
There's more likely to be performance regressions lurking in the hasql-pool rewrite, though the new version is simple enough that I don't expect anything there either. (The current hasql-pool version relies on an old resource-pool release, which uses STM just the same as the new hasql-pool, so I don't see any reason for new overhead as compared to the old version. Judging by the recent rewrite of resource-pool with non-STM for "better throughput and latency" there might be some room for improvement though.)
@robx I think this should be good to merge. Or should we wait on closing https://github.com/nikita-volkov/hasql-pool/pull/16 or https://github.com/PostgREST/postgrest/issues/2422?
@robx I think this should be good to merge. Or should we wait on closing nikita-volkov/hasql-pool#16 or #2422?
I think it's time to fork (not just for this issue but those other hasql issues too). Here's a clone of nikita-volkov/hasql-pool#16: https://github.com/PostgREST/hasql-pool/pull/1.
Closing in favour of #2454.