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

Handle async exceptions correctly in bracket and finally. #6

Merged
merged 1 commit into from
Jul 11, 2014
Merged

Handle async exceptions correctly in bracket and finally. #6

merged 1 commit into from
Jul 11, 2014

Conversation

dterei
Copy link
Contributor

@dterei dterei commented Jul 10, 2014

When I used the latest simple with povo ran into an issue where withConnection wasn't correctly running it's finally / bracket clause to return the connection back to the MVar. Investigating showed I needed to mask async exceptions for finally and bracket to behave as expected.

@alevy
Copy link
Owner

alevy commented Jul 11, 2014

And mask needs to wrap the entire operation (including aquire etc), which is why we can't just do it in onException?

alevy added a commit that referenced this pull request Jul 11, 2014
Handle async exceptions correctly in bracket and finally.
@alevy alevy merged commit 693d2fb into alevy:master Jul 11, 2014
@dterei
Copy link
Contributor Author

dterei commented Jul 11, 2014

Yeah, you essentially want the operations to be atomic, so treat mast like taking a lock over the whole thing but we can use the restore callback to re-enable exceptions in just a sub-computation.

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

Successfully merging this pull request may close these issues.

2 participants