-
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
2.x -- groupBy with evicting map -- seeing inconsistent behavior when eviction occurs #5933
Comments
Yes, looks like eviction only happens when an upstream item is coming down. I think the same eviction logic could be run in @Override
public void cancel() {
// cancelling the main source means we don't want any more groups
// but running groups still require new values
if (cancelled.compareAndSet(false, true)) {
if (evictedGroups != null) {
GroupedUnicast<K, V> evictedGroup;
while ((evictedGroup = evictedGroups.poll()) != null) {
evictedGroup.onComplete();
}
}
if (groupCount.decrementAndGet() == 0) {
s.cancel();
}
}
} /cc @davidmoten |
Thanks for the report, I'll fix tomorrow |
davidmoten
added a commit
to davidmoten/RxJava
that referenced
this issue
Apr 3, 2018
davidmoten
added a commit
to davidmoten/RxJava
that referenced
this issue
Apr 3, 2018
Sorry for the delay. I'll try to tackle this in the coming weeks. |
davidmoten
added a commit
to davidmoten/RxJava
that referenced
this issue
May 29, 2018
akarnokd
pushed a commit
that referenced
this issue
May 29, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am using version 2.1.11. I'm seeing what I believe to be a bug in the groupBy operator when configured to use an evicting map. Here is a test that demonstrates what I'm seeing:
As you can see from this when a group eviction occurs and the root subscription is canceled, the cancel dose not propagate beyond the
groupBy
(it does when there is no eviction). I think the reason for this is that after the eviction processing (line 188 of FlowableGroupBy) the groupCount is 3 when I believe it should be 2). This leads the groupBy to conclude that there are 2 active groups when the cancel occurs, when in fact there is only one. This doesn't happen when there is no eviction (you can see this by commenting out the line that updates "tick").The text was updated successfully, but these errors were encountered: