-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Window Unsubscribes Early? #1546
Comments
This is a bug, but it's been a bug for a while and doesn't affect public APIs so moving from 1.0 to 1.x milestone. |
What happens is that take(10) shuts down the emitter thread as soon as it receives the 10th Observable so the downstream receives random amount of data before the emitter checks again its client for unsubscription. Changing it to buffer(10) gives the required 10 items and doesn't hang. hotStream().buffer(10).take(5).flatMap(w -> {
return Observable.from(w).startWith(999999999);
}).toBlocking().forEach(System.out::println); |
The hang happens because the flatMap never receives an onCompleted from the emitter and thus unable to release the latch in the blocking forEach. |
Split the unit tests up to match the implementation files. Add unit tests for ReactiveX#1546 to OperatorWindowWithSizeTest
- ReactiveX#1546 - This also fixes the fact that the overlapping window overload was not propagating unsubscribe before. A new unit test caught that.
The following example should always have 10 items, including in the last window, but it non-deterministically has less, as if the unsubscribe from
take
is happening immediately and not letting it finish.The text was updated successfully, but these errors were encountered: