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

RefCount: disconnect all if upstream terminates #2567

Merged

Conversation

akarnokd
Copy link
Member

This should fix the problem in #2564. @davidmoten I hope you can review the changes and implications.

The particular issue was caused by the refCount unable to unsubscribe from upstream in case the current client count was greater than 1. If the upstream sent an error and each client had a retry() in its chain, the retry would immediately resubscribe, thus the refCount would see only a 2 -> 1 -> 2 change in sequence as errors are dispatched sequentially. In the change, each client is wrapped and a termination event triggers the refcount to become 0 atomically and unsubscribes the upstream. When each client then call disconnect, that becomes a no-op.

@davidmoten
Copy link
Collaborator

Thanks for chasing this @akarnokd. I'll have a look this weekend.

@davidmoten
Copy link
Collaborator

Looks good @akarnokd. There are a couple of my comments that are unclear (referring to Action1) but I can fix those later if you like. Can we squeeze this into 1.0.5?

@akarnokd
Copy link
Member Author

akarnokd commented Feb 3, 2015

@benjchristensen seems to be eager to release soon, but if your comments are something that can be done within a few minutes, I can do the changes before release.

@benjchristensen
Copy link
Member

This looks good to me. @akarnokd Should I proceed with it or would you still like to wait for @davidmoten to review?

@benjchristensen
Copy link
Member

I was working off a stale browser tab so hadn't seen your comments. If both of you are okay with this then I'm ready to merge and release.

@akarnokd
Copy link
Member Author

akarnokd commented Feb 3, 2015

Its getting late here, but we can perhaps give @davidmoten some time while you could review #2592 and #2493.

@benjchristensen
Copy link
Member

Okay, that works for me.

@akarnokd
Copy link
Member Author

akarnokd commented Feb 3, 2015

Let's merge this as-is and @davidmoten will post a PR with his changes for 1.0.6. I'll leave it up to you @benjchristensen whether to merge #2493 and #2580 for 1.0.5.

@davidmoten
Copy link
Collaborator

I was referring to code comments being slightly out of sync with the code
but nothing serious. I think it can wait till another release as I'm not
able to do a PR at the moment. In a few hours can do but happy if release
goes with this fix in the meantime.
On 4 Feb 2015 09:08, "David Karnok" [email protected] wrote:

Its getting late here, but we can perhaps give @davidmoten
https://github.com/davidmoten some time while you could review #2592
#2592 and #2493
#2493.


Reply to this email directly or view it on GitHub
#2567 (comment).

benjchristensen added a commit that referenced this pull request Feb 4, 2015
RefCount: disconnect all if upstream terminates
@benjchristensen benjchristensen merged commit 79bd261 into ReactiveX:1.x Feb 4, 2015
@akarnokd akarnokd deleted the RefCountDisconnectOnTerminalEvent branch May 6, 2015 06:49
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.

3 participants