-
Notifications
You must be signed in to change notification settings - Fork 751
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
Suspected race condition in Throttle operator #1493
Labels
Comments
Seems like |
Thank you for fixing this so quickly! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, we believe we have identified a race condition in the
Throttle
operator:Reproduced in 4.1.0 and 5.0.0
Reproduced with
Windows 10 20H2
.NET 5.0 (with system.reactive 5.0.0)
.NET Framework 4.8 (with system.reactive 4.1.0)
If a second event arrives at the
Throttle(TimeSpan dueTime)
operator at almost exactly the same time as a cached event is due to be propagated, then neither will be emitted. I have reproduced this withThrottle(TimeSpan.Zero)
but believe that it could happen with any timespan if a second or subsequent event arrives at an inopportune time.A review of the code suggests the following interaction can occur between Throttle._.OnNext and Throttle._.Propagate
If two items arrive at
OnNext
in quick succession:OnNext(1):
OnNext(2):
Propagate(1):
Propagate(2):
An event is emitted if no further events are received within the Throttle dueTime.
No event is emitted
N/A
Example .NET 5 console app referencing System.Reactive 5.0.0
The text was updated successfully, but these errors were encountered: