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

Fix for #2191 - OperatorMulticast fails to unsubscribe from source #2455

Merged
merged 2 commits into from
Jan 21, 2015

Conversation

duncani
Copy link
Contributor

@duncani duncani commented Jan 15, 2015

OperatorMulticast fails to unsubscribe from source. #2191

@benjchristensen
Copy link
Member

The multicast operator was removed from the public API before releasing 1.0. These internal classes will eventually go away as well.

@zsxwing
Copy link
Member

zsxwing commented Jan 15, 2015

@benjchristensen OperatorMulticast is still used in replay.

@benjchristensen
Copy link
Member

I know. But it will eventually be removed.

@duncani
Copy link
Contributor Author

duncani commented Jan 15, 2015

Fair enough, but in the meantime, we're still seeing thousands of Threads
being created only to be used once and never released. Could we define
"eventually"? :)

On 15 January 2015 at 16:33, Ben Christensen notifications@github.com
wrote:

I know. But it will eventually be removed.


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

Don't let your mind wander -- it's too little to be let out alone.

@benjchristensen
Copy link
Member

Couple months :-)

Sorry, I'm not suggesting we don't fix it now. I did a poor job of setting context for this code :-)

@zsxwing
Copy link
Member

zsxwing commented Jan 15, 2015

@duncani could you update the title? You don't need to put the link in the title. Just refer to the issue number, such as Fix for #2191 - OperatorMulticast fails to unsubscribe from source.

@duncani duncani changed the title Fix for https://github.com/ReactiveX/RxJava/issues/2191 - OperatorMultic... Fix for #2191 - OperatorMulticast fails to unsubscribe from source Jan 15, 2015
@duncani
Copy link
Contributor Author

duncani commented Jan 15, 2015

Ok, given that multicast is going away, I've moved the test cases over to OperatorReplayTest (since that's what they're really testing anyway). They'll still be a valid test for however replay gets reimplemented.

@benjchristensen
Copy link
Member

Great, that's the type of decisions I was trying to influence by mentioning that OperatorMulticast would be removed. Thank you @duncani.

@akarnokd
Copy link
Member

I'm not sure why multicast would need to unsubscribe if the upstream completes: usually, the upstream goes away and as long as you don't retain a reference to the multicast operator itself, this shouldn't leak anything. Could you enlighten me?

@duncani
Copy link
Contributor Author

duncani commented Jan 21, 2015

Specifically, when employing a Scheduler, it is registered as a subscription on the Subscriber. If you don't unsubscribe, the Scheduler is never released. In the case of the current computation scheduler, nothing much is lost. However, this is fatal for the CachedThreadScheduler.

@akarnokd
Copy link
Member

Thanks I see it now.

@akarnokd
Copy link
Member

Let's see if this still fails.

@akarnokd akarnokd closed this Jan 21, 2015
@akarnokd akarnokd reopened this Jan 21, 2015
akarnokd added a commit that referenced this pull request Jan 21, 2015
Fix for #2191 - OperatorMulticast fails to unsubscribe from source
@akarnokd akarnokd merged commit 0d96903 into ReactiveX:1.x Jan 21, 2015
@benjchristensen benjchristensen mentioned this pull request Feb 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants