postgrest icon indicating copy to clipboard operation
postgrest copied to clipboard

Upgrade hasql-pool

Open robx opened this issue 3 years ago • 3 comments

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.

robx avatar Jul 27 '22 10:07 robx

@steve-chavez I believe I've addressed the review comments, could you have another look?

robx avatar Aug 08 '22 07:08 robx

Q: With the new flushPool, do see any performance impact in comparison to the old releasePool?

steve-chavez avatar Aug 08 '22 17:08 steve-chavez

Q: With the new flushPool, do see any performance impact in comparison to the old releasePool?

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 avatar Aug 08 '22 18:08 robx

@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?

steve-chavez avatar Aug 24 '22 00:08 steve-chavez

@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.

robx avatar Aug 24 '22 07:08 robx

Closing in favour of #2454.

robx avatar Aug 29 '22 15:08 robx