Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PaymentServer/Ristretto.hs uses Control.Exception.bracket which uses interruptable masking #75

Open
exarkun opened this issue Oct 30, 2020 · 0 comments

Comments

@exarkun
Copy link
Collaborator

exarkun commented Oct 30, 2020

From https://www.snoyman.com/blog/2020/10/haskell-bad-parts-1:

And Control.Exception.bracket uses interruptible masking for it’s cleanup handler. So if you need to perform some kind of blocking action in your cleanup, and you want to make sure that you don’t get interrupted by an async exception, you have to remember to use uninterruptibleMask yourself. Otherwise, your cleanup action may not complete, which is Bad News Bears.

The Ristretto code uses bracket to ensure memory gets freed. Only if it gets interrupted by an async exception, then maybe the memory won't be free after all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant