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

Stop exceptions from causing an infinite loop. #332

Merged
merged 2 commits into from
Dec 13, 2021

Conversation

nplevin
Copy link
Contributor

@nplevin nplevin commented Oct 4, 2021

This PR modifies insert Atomic to return the result of the action argument, if it's available. If the result is an exception, lookupOrLoad will now raise the exception rather than recursing (thus stopping the loop). If I did it right, the behavior of lookupOrLoad otherwise should almost be the same as before. The only other difference should be how the general exit case is handled in insertAtomic. If we get an exception other than the cancelled case, we'll raise that as well in lookupOrLoad. (Not sure what other errors can arise here other than maybe fatal ones, since the other operations are wrapped in attempts).

The test "only run till errors cease" is now broken, since that behavior is changed different here and I'm not sure what you want the test to look like now.

Fixes #330

@ChristopherDavenport ChristopherDavenport marked this pull request as ready for review November 22, 2021 21:47
@ChristopherDavenport ChristopherDavenport merged commit b5bd22d into davenverse:series/0.4 Dec 13, 2021
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