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/Persistence.hs uses Control.Exception.bracket which uses interruptable masking #76

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 persistence code uses bracket to ensure SQLite3 connections get closed. Only if it gets interrupted by an async exception, then maybe the connection won't be closed after all. This might lead to deadlocks or file descriptor leaks.

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