Fix FlowableCache GC issue - #8249
Merged
akarnokd merged 1 commit intoJul 27, 2026
Merged
Conversation
3 tasks
🐷 TruffleHog + Entropy Beauty ScanAverage entropy of changed code: 4.465 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 #8249 +/- ##
============================================
- Coverage 98.64% 98.63% -0.02%
+ Complexity 7160 7125 -35
============================================
Files 822 822
Lines 50683 50690 +7
Branches 6889 6892 +3
============================================
- Hits 49998 49996 -2
- Misses 472 478 +6
- Partials 213 216 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
akarnokd
approved these changes
Jul 27, 2026
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.
Summary
FlowableCacheinto a staticMulticaster.headon the outerFlowableCache, while the upstream retains only the shared multicaster state and currenttail.Rationale
Previously, the upstream subscribed directly to the outer
FlowableCache. This allowed the upstream connection to retain the outer cache and itshead, keeping all cached nodes reachable even after application code could no longer create another subscription to that cache instance.With the ownership split, the upstream retains only the static
Multicaster. Once the outerFlowableCachebecomes unreachable, consumed node prefixes can be reclaimed, while active subscribers continue to retain the suffix they still need.The established behavior remains unchanged for valid upstream signals: the source is subscribed to at most once, the upstream is requested with
Long.MAX_VALUE, each downstream keeps independent request accounting, replay remains serialized per downstream, and cancellation removes only that downstream without cancelling the shared upstream.Validation
Local validation performed by the contributor:
FlowableCacheTestpassed.valuesAreReclaimablepassed in five independent runs.checkstyleMainandcheckstyleTestpassed../gradlew buildpassed on Temurin 26.git diff --checkpassed.AI disclosure
I used an AI assistant to help analyze the
FlowableCacheretention graph, adapt the ownership-split approach to RxJava 4.x, and review the concurrency and regression-test implications.I reviewed and decided the final implementation, performed the validation listed above, and am responsible for the code and submission.
References