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

1.x: fix premature cleanup in AsyncOnSubscribe when the last Observable is still running #5430

Merged
merged 1 commit into from
Jun 23, 2017

Conversation

yurgisbaykshtis
Copy link

The issue is caused by premature cleanup when onCompleted is emitted from the callback function which may happen while a requested async sequence is still not completed.
The unit test is provided which will fail without the fix.
More cases are provided in the issue #5429.

@akarnokd
Copy link
Member

Thanks for looking into this.

@akarnokd akarnokd added this to the 1.4 milestone Jun 21, 2017
@codecov
Copy link

codecov bot commented Jun 21, 2017

Codecov Report

Merging #5430 into 1.x will decrease coverage by 0.06%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##                1.x    #5430      +/-   ##
============================================
- Coverage     84.38%   84.32%   -0.07%     
+ Complexity     2887     2884       -3     
============================================
  Files           291      291              
  Lines         18129    18129              
  Branches       2479     2479              
============================================
- Hits          15298    15287      -11     
- Misses         1965     1972       +7     
- Partials        866      870       +4
Impacted Files Coverage Δ Complexity Δ
src/main/java/rx/observables/AsyncOnSubscribe.java 68.35% <100%> (+1.68%) 5 <0> (ø) ⬇️
...java/rx/internal/schedulers/ExecutorScheduler.java 77.46% <0%> (-4.23%) 2% <0%> (ø)
...ava/rx/internal/operators/OperatorMaterialize.java 85.24% <0%> (-3.28%) 3% <0%> (ø)
...n/java/rx/subscriptions/CompositeSubscription.java 74.02% <0%> (-2.6%) 24% <0%> (ø)
...ternal/operators/OperatorOnBackpressureLatest.java 80.95% <0%> (-1.91%) 3% <0%> (ø)
...c/main/java/rx/observables/BlockingObservable.java 85.61% <0%> (-1.44%) 37% <0%> (-1%)
...main/java/rx/internal/operators/OperatorMerge.java 86.37% <0%> (-1.16%) 7% <0%> (ø)
...in/java/rx/internal/operators/OperatorPublish.java 78.48% <0%> (-0.85%) 8% <0%> (ø)
src/main/java/rx/Completable.java 83.24% <0%> (-0.13%) 102% <0%> (-1%)
.../rx/internal/schedulers/CachedThreadScheduler.java 89.32% <0%> (+0.97%) 6% <0%> (ø) ⬇️
... and 2 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 433b099...6dc42dd. Read the comment docs.

@akarnokd akarnokd changed the title fix for https://github.com/ReactiveX/RxJava/issues/5429 1.x: fix premature cleanup in AsyncOnSubscribe when the last Observable is still running Jun 21, 2017
Copy link
Member

@akarnokd akarnokd left a comment

Choose a reason for hiding this comment

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

Will take this for now. The whole operator needs an overhaul otherwise.

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.

None yet

2 participants