[Problem] Fix FlowableCache GC issue - #8247
Conversation
Split the source-facing subscriber state from FlowableCache so the upstream connection no longer retains the cache head. Preserve per-subscriber backpressure and replay semantics, clear the tail on termination, and add a focused heap-reclamation regression test.
🐷 TruffleHog + Entropy Beauty ScanAverage entropy of changed code: 4.647 bits/char Changed files entropy: ✅ No secrets or suspicious high-entropy strings found. Mid-4 beauty heuristic in action — powered by our entropy chats! 😊 |
|
Looks okay, but how much do you need this in 3.x? I'd prefer you primarily target 4.x first and then backport if someone does have a need for in 3.x. I don't want to release more 3.x versions that aren't bug or crash fixes. This issue is more like GC pedantics than a grave mistake. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 3.x #8247 +/- ##
============================================
- Coverage 99.62% 99.61% -0.01%
+ Complexity 6801 6744 -57
============================================
Files 752 752
Lines 47707 47727 +20
Branches 6401 6404 +3
============================================
+ Hits 47527 47544 +17
+ Misses 84 80 -4
- Partials 96 103 +7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Also if you used AI, you have to disclose it, even for mechanistical changes. I'm sorry but I have to do this on a high visibility attractive project like RxJava. If you do not respond to change request in a reasonable time, indicated by your public github activity profile, or your contribution causes an effort amplification (i.e., I now have to port your changes over to 4.x and do all sorts of extra steps for no apparent reason or benefit), you will be banned and publicly shamed. |
akarnokd
left a comment
There was a problem hiding this comment.
Please target 4.x first and we can discuss how much you, or anyone else needs this GC pedantic change backported into 3.x
|
Thank you for the guidance. I have opened #8249 as a clean 4.x version of this change, targeting the current 4.x branch as requested. I am closing this PR as superseded, and I will only revisit a 3.x backport if there is a concrete need after the 4.x change is reviewed. |
Summary
Multicaster, so the upstream connection and activeCacheSubscriptions no longer retain the outerFlowableCache.FlowableCache, retain the current tail fromMulticaster, and clear the tail on termination.MemoryMXBean/System.gc()regression test matching the approach used forObservableCachein Fix ObservableCache GC issue #7911.Tests
./gradlew build --stacktrace./gradlew javadoc --stacktraceFlowableCacheTest.valuesAreReclaimablerepeated five timesReferences
FlowableCacheitem in 4.x: Cache/Replay operators to be more GC friendly #7912.ObservableCachein Fix ObservableCache GC issue #7911 while preserving Flowable-specific backpressure semantics.Checklist
FlowableCacheTestcoverage continues to exercise empty, range, error, backpressure, cancellation, and race behavior.