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

2.x: fix LambdaObserver not cancelling the upstream #5170

Merged
merged 1 commit into from
Mar 10, 2017

Conversation

akarnokd
Copy link
Member

The LambdaObserver didn't cancel the upstream when its onSubscribe and onNext callbacks crashed. Also reported on the mailing list:

Dave Smith: When I am using an operator in Observable that calls subscribe (forEach as a example) and the onNext function throws an Exception the underlying class (LambdaObserver) marks the subscription disposed but does not notify upstream that is is disposed. What is the reason for this?

The LambdaSubscriber was working correctly. Both received unit tests to ensure the correct behavior.

@akarnokd akarnokd added this to the 2.0 backlog milestone Mar 10, 2017
@codecov
Copy link

codecov bot commented Mar 10, 2017

Codecov Report

Merging #5170 into 2.x will decrease coverage by <.01%.
The diff coverage is 100%.

@@             Coverage Diff              @@
##                2.x    #5170      +/-   ##
============================================
- Coverage     95.94%   95.94%   -0.01%     
+ Complexity     5658     5656       -2     
============================================
  Files           621      621              
  Lines         39972    39974       +2     
  Branches       5610     5610              
============================================
  Hits          38352    38352              
+ Misses          643      642       -1     
- Partials        977      980       +3
Impacted Files Coverage Δ Complexity Δ
src/main/java/io/reactivex/Observable.java 100% <ø> (ø) 506 <0> (ø)
...operators/observable/ObservableInternalHelper.java 86.31% <ø> (ø) 18 <0> (ø)
...o/reactivex/internal/observers/LambdaObserver.java 100% <100%> (ø) 12 <0> (ø)
...al/operators/observable/ObservableSampleTimed.java 88.33% <0%> (-8.34%) 3% <0%> (ø)
.../java/io/reactivex/subjects/SerializedSubject.java 89.47% <0%> (-6.32%) 26% <0%> (-1%)
...l/operators/observable/ObservableFlatMapMaybe.java 89.54% <0%> (-5.89%) 2% <0%> (ø)
...ternal/operators/completable/CompletableUsing.java 95.23% <0%> (-4.77%) 4% <0%> (ø)
...a/io/reactivex/internal/util/QueueDrainHelper.java 60.28% <0%> (-4.26%) 32% <0%> (-3%)
.../operators/observable/ObservableFlatMapSingle.java 91.79% <0%> (-3.74%) 2% <0%> (ø)
...ava/io/reactivex/internal/util/HalfSerializer.java 97.5% <0%> (-2.5%) 22% <0%> (-1%)
... and 32 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b5501c5...b9942bb. Read the comment docs.

@akarnokd akarnokd merged commit f059ded into ReactiveX:2.x Mar 10, 2017
@akarnokd akarnokd deleted the LambdaObserverCancel branch March 10, 2017 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants