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

GroupBy backpressure fix #3428

Merged
merged 1 commit into from
Dec 7, 2015
Merged

Conversation

akarnokd
Copy link
Member

@akarnokd akarnokd commented Oct 9, 2015

This is a backport of the 2.x GroupBy operator which solves #3425.

One unit test in OperatorRetryTest had to be altered a bit. I believe
the original code relied on a GroupBy behavior which caused the bug in
#3425.

@akarnokd akarnokd added the Bug label Oct 9, 2015
@akarnokd akarnokd added this to the 1.0.x milestone Oct 9, 2015
@stealthcode
Copy link

The following test starts breaking with this branch. It prints out 1 to 128 then stops and does not print anything else (apparently no progress is made). In branch 1.x this continues to print past 128.

range(1, RxRingBuffer.SIZE *4).repeat()
    .groupBy((d) -> d)
    .flatMap((go) ->
        go.doOnNext(System.out::println)
            .subscribeOn(Schedulers.io())
    )
    .subscribe();

@akarnokd
Copy link
Member Author

This is because the lack of horizontal unboundedness of flatMap and the bug in groupBy together made it work in 1.0.14. If I run this code with the 2.x fix and add 1024 as the max concurrency value, it prints lots of values indefinitely.

public void call(GroupedObservable<Object, Integer> g) {
g.subscribe();
}
}) // this will request Long.MAX_VALUE

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this comment meant for the inner observable? The outer observable gets a request of 128.

@akarnokd
Copy link
Member Author

I've updated the comments.

@stealthcode
Copy link

👍

akarnokd added a commit that referenced this pull request Dec 7, 2015
@akarnokd akarnokd merged commit 072e6c2 into ReactiveX:1.x Dec 7, 2015
@akarnokd akarnokd deleted the GroupByBackpressureFix1x branch December 7, 2015 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants