Skip to content

1.x: map() and filter() should unsubscribe on crash eagerly #3890

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

Merged
merged 1 commit into from
Apr 29, 2016

Conversation

akarnokd
Copy link
Member

In current master, when the function in map or filter crashes, the error is propagated but the upstream is not immediately unsubscribed but expected to happen eventually due to some other operator or SafeSubscriber.

The fix, and also the restructuring of the unsubscription chain, makes sure the crash also unsubscribes immediately (unless a fatal one).

Related: StackOverflow question

@akarnokd akarnokd added the Bug label Apr 28, 2016

@Override
public void setProducer(Producer p) {
actual.setProducer(p);
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing a call to super.setProducer?

Copy link
Member Author

Choose a reason for hiding this comment

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

Map doesn't request on its own, unlike filter, so it can just pass along the producer to downstream.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, yeah. Makes sense.

@stevegury
Copy link
Member

👍

@akarnokd akarnokd merged commit dec05b2 into ReactiveX:1.x Apr 29, 2016
@akarnokd akarnokd deleted the MapFilterCrashHandling branch April 29, 2016 20:44
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