bos / pool

A high-performance striped resource pooling implementation for Haskell

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Async exception safety?

merijn opened this issue · comments

As far as I can tell, the handlers for resource cleanup handle in a regular mask, rather than an uninterruptibleMask. This means the handler can get interrupted and aborted midway if cleanup performs a blocking operation and an async exception arrives during this time. Perhaps resource cleanup should run in uninterruptibleMask? Alternatively, this problem should be documented on the page, so users can take relevant precautions themselves.

https://hackage.haskell.org/package/safe-exceptions is available, recently reimplemented by https://hackage.haskell.org/package/unliftio.

I'd like to see this package to move from MonadBaseControl to MonadUnliftIO if possible. I'm happy to provide a patch if the maintainers agree!

This is an old work account. Please reference @brandonchinn178 for all future communication


Bump. Would be great to use MonadUnliftIO instead of MonadBaseControl.

cc @bos