fpco / unliftio

The MonadUnliftIO typeclass for unlifting monads to IO
Other
151 stars 51 forks source link

Fix `cancel` in exception handling code #96

Open parsonsmatt opened 2 years ago

parsonsmatt commented 2 years ago

Initial discussion: https://github.com/fpco/safe-exceptions/issues/3

Follow-up on GHC: https://gitlab.haskell.org/ghc/ghc/-/issues/18899

🤔

Fixes #95

parsonsmatt commented 1 year ago

Hate to be a squeaky wheel, but this has now bitten us 3 times, resulting in non-graceful SIGKILL shutdowns

I've made the patch locally to ensure that all Async functions in our codebase are going to be unmasking their actions (if cancel is an important part of the API - so withAsync, race, etc).

snoyberg commented 1 year ago

Fair enough, let's try to move forward on this then. Can I ask you to put together a ChangeLog entry in here that makes it clear that there's a subtle behavioral change in this release?

Also: what do you think of posting this on the Haskell Foundation Discourse and giving people a heads-up that this change will be coming before releasing? I'm a bit worried about encouraging a debate on it, but also a bit worried about this one sneaking under people's radars.

parsonsmatt commented 1 year ago

I think getting some feedback would be great. At the very least, maybe we can get some more eyes on this ticket: https://gitlab.haskell.org/ghc/ghc/-/issues/22389 the solution to which would introduce a new primitive that should make this a bit safer.

snoyberg commented 1 year ago

Would you be able to publish such a message? I'll be happy to boost with links from Twitter.