-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
STM retry/orElse semantics #8696
Comments
Based on this part of the documentation, it probably should work like haskell. And note, that for |
/bounty $250 for fix and test to accompany it. |
💎 $250 bounty • ZIOSteps to solve:
Additional opportunities:
Thank you for contributing to zio/zio! Add a bounty • Share on socials
|
/attempt #8696 Options |
💡 @BijenderKumar1 submitted a pull request that claims the bounty. You can visit your bounty board to reward. |
* Resolve journal reset issue with orElse function definition * Remove extra braces * Resolve Formatting issues, CI Test Failures, and add a new test for LHS variable updates in orElse Test Suite * Make reset function private * Review unnecessary comment * Resolve linting errors
🎉🎈 @BijenderKumar1 has been awarded $250! 🎈🎊 |
This issue is a case of "behaves differently from Haskell",
so I'm not even sure this is a bug.(Although the Haskell behavior seems more useful to me.)Apparently, Haskell's STM retries a transaction if any of the variables read in any branch of an
orElse
change. (See section 3.4 here.) It seems ZSTM doesn't do this: it only retries if theTRef
read by the RHS/second transaction changes. For example, this program hangs:The text was updated successfully, but these errors were encountered: