Fix resource pool regression in persistent-mysql-haskell, persistent. - #5
Fix resource pool regression in persistent-mysql-haskell, persistent.#5swamp-agr wants to merge 2 commits into
persistent-mysql-haskell, persistent.#5Conversation
e9825fc to
7d75de5
Compare
|
Note: this is a PR into "persistent-mysql-haskell-9.2" branch of the current fork. |
|
Will try to have a look at the code tomorrow, but since this resource-pool update also caused issues in hedis and I would expect a library like resource-pool to not make it so easy to leak things, I'm wondering why the behaviour was changed this way and why we aren't fixing it more "centrally". Do you know? |
|
Unfortunately, that is by design and that is why resource-pool bumped the major version (from
The reason why they added this was inability to destroy the resource by throwing an asynchronous exception from another thread. For instance And of course, silently swallowing exceptions will lead to situations where such bugs would be very hard to catch. The same reason why we made a change Redis-schema on decoding errors. |
| loggedClose backend = | ||
| loggedClose backend = UE.uninterruptibleMask_ $ | ||
| close' backend `UE.catchAny` \e -> do | ||
| runLoggingT |
There was a problem hiding this comment.
If resource-pool doesn't swallow exceptions anymore now, wouldn't the exceptions be logged twice with this now?
|
After looking at the issue that was fixed by the resource pool change and the PR in which the change was implemented, I remain unconvinced that the change is an improvement. If anything, resource-pool could have changed the API such that the If you agree, I think we should take up discussion with the |
This PR fixes regression introduced in
resource-pool-0.5.0.0. It sets bracket on connection errors and makes closing connection uninterruptible. Second commit fixesloggedClosefrompersistentby making it uninterruptible since it could be interrupted, resource-pool is no longer guaranteeing that.