-
-
Notifications
You must be signed in to change notification settings - Fork 96
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
Select
/ Switch
race condition
#229
Comments
You could try building and linking R3 package from my forked repo from the pull request with fixed ReactiveProperty and see if it helps. |
Tried your fork, it definitely solves it in the test case, so looks like the same underlying cause. I will try it on our full code base. Many thanks for your issue and patch, I had started down the same lines of investigation and was scattering logging and extra locks in Select/Switch without it helping, they just made the problem occur less frequently. I will check with our full code and post results, happy to close as a dupe of #228. |
After testing with our wider codebase, the PR from @nepolak with the locks does fix the issue. I understand the reluctance to use heavy locking, it might be possible to add a fast-path flag that skips the lock once the window where the race condition has passed? As #228 is closed without merging the above mentioned PR, this still stands as a separate reproducible bug. |
Finally, we added |
There seems to be a race in
Switch
similar to issue #228Below is a distilled test-case of the code that triggers it. I'm not sure what the guarantees are about threaded calls to
OnNext
, we basically ported fromdotnet/reactive
toR3
and came across the issue very intermittently.Uncommenting the
await Task.Delay(10);
makes it almost always go away.First three runs of the code for me produce different results:
The text was updated successfully, but these errors were encountered: