Repository navigation
4.x: Fix Streamable.takeUntil missing stop signals with synchronous sources - #8406
Merged
akarnokd merged 1 commit intoNov 28, 2026
Merged
Conversation
…ources Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
akarnokd
approved these changes
Nov 28, 2026
🐷 TruffleHog + Entropy Beauty ScanAverage entropy of changed code: 4.668 bits/char Changed files entropy: ✅ No secrets or suspicious high-entropy strings found. Mid-4 beauty heuristic in action — powered by our entropy chats! 😊 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 4.x #8406 +/- ##
============================================
- Coverage 98.63% 98.61% -0.03%
Complexity 7184 7184
============================================
Files 826 826
Lines 51043 51048 +5
Branches 6946 6947 +1
============================================
- Hits 50346 50340 -6
- Misses 474 479 +5
- Partials 223 229 +6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Streamable.range(1, 5).takeUntil(Streamable.empty())emitted all five values before completing. The same five values escaped when the stop timer fired during the first synchronous pull. The operator started the upstream pull and registered its result before the stop callback (src/main/java/io/reactivex/rxjava4/internal/operators/streamable/StreamableTakeUntil.java:79).next()now registers the stop callback before pulling upstream. It skips the pull if the stop stage has already signalled and cancels an active pull as soon as the stop wins. If the upstream pull wins, its item remains available tocurrent()(src/main/java/io/reactivex/rxjava4/internal/operators/streamable/StreamableTakeUntil.java:79).The
Streamable.takeUntil(Streamable)overload is the sole constructor caller (src/main/java/io/reactivex/rxjava4/core/Streamable.java:1421).FlowableTakeUntilandObservableTakeUntilsubscribe to the stop source first and already emit zero values in the synchronous empty-stop case.Checks
The regressions cover zero upstream reads with an empty stop and cancellation inside the synchronous pull when its timer fires (
src/test/java/io/reactivex/rxjava4/internal/operators/streamable/StreamableTakeUntilTest.java:68and:82).On JDK 26, 1,240 tests passed and 82 were skipped. Checkstyle 10.24.0 reported zero diagnostics in both changed files.
AI disclosure
Codex and Claude Code were used to investigate the bug, prepare the code and tests, and draft this description.
Prepared with AI assistance (Codex and Claude Code) and reviewed with GitHub Copilot.
🤖 Generated with Claude Code