pool icon indicating copy to clipboard operation
pool copied to clipboard

Async exception safety?

Open merijn opened this issue 6 years ago • 2 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.

merijn avatar Jan 23 '18 13:01 merijn

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!

mitchellwrosen avatar Feb 28 '18 02:02 mitchellwrosen

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


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

cc @bos

brandon-leapyear avatar Nov 22 '20 22:11 brandon-leapyear