Skip to content

4.x: Streamable.timer to dispose the executor/scheduler upon finish - #8286

Merged
akarnokd merged 1 commit into
ReactiveX:4.xfrom
akarnokd:4xStreamableTimerTaskLeak
Aug 11, 2026
Merged

4.x: Streamable.timer to dispose the executor/scheduler upon finish#8286
akarnokd merged 1 commit into
ReactiveX:4.xfrom
akarnokd:4xStreamableTimerTaskLeak

Conversation

@akarnokd

@akarnokd akarnokd commented Aug 11, 2026

Copy link
Copy Markdown
Member

Forgot to cleanup the resource (Scheduler.Worker, Future) upon finish executing. Just setting it to DISPOSED can lead to worker leak or task occupying the executor until their timer runs out.

Trivial fix.

Testing it, however, needed a TestScheduler update:

  • worker dispose should remove outstanding work in the shared queue for that specific worker
  • ability to check how many outstanding tasks are still in the scheduler.

Reported as ??? security vulnerability ??? via AI tool and zero human understanding

@August829

RxJava-11: StreamableTimer.finish() Bypasses DisposableHelper.dispose(), Leaving the Real Scheduled Task/Thread Running

🛑 Do not report memory or resource leaks as security vulnerabilities 🛑

These are ordinary oversights or corner case bugs, in an alpha library, that goes up to maven central so that the brave can look at it, and allows me to use it in other companion libraries already.

I've updated the SECURITY.md to emphasize it again; do not report leaks as security vulnerabilities. Post an issue or PR.

Resolves #8285

@akarnokd akarnokd added this to the 4.0 milestone Aug 11, 2026
@github-actions

Copy link
Copy Markdown

🐷 TruffleHog + Entropy Beauty Scan

Average entropy of changed code: 4.586 bits/char
Verdict: ✅ Mid-4 beauty detected (thoughtful human code!)

Changed files entropy:

SECURITY.md: 4.613
src/main/java/io/reactivex/rxjava4/internal/operators/streamable/StreamableTimer.java: 4.533
src/main/java/io/reactivex/rxjava4/schedulers/TestScheduler.java: 4.533
src/test/java/io/reactivex/rxjava4/internal/operators/streamable/StreamableTimerTest.java: 4.664

✅ No secrets or suspicious high-entropy strings found.

Mid-4 beauty heuristic in action — powered by our entropy chats! 😊

@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.61%. Comparing base (61b02bb) to head (9437898).
⚠️ Report is 1 commits behind head on 4.x.

Additional details and impacted files
@@            Coverage Diff            @@
##                4.x    #8286   +/-   ##
=========================================
  Coverage     98.60%   98.61%           
+ Complexity     7148     7147    -1     
=========================================
  Files           824      824           
  Lines         50789    50791    +2     
  Branches       6910     6911    +1     
=========================================
+ Hits          50080    50086    +6     
- Misses          477      481    +4     
+ Partials        232      224    -8     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@akarnokd akarnokd changed the title 4.x: Streamable.timer to cancel the executor/scheduler upon finish 4.x: Streamable.timer to dispose the executor/scheduler upon finish Aug 11, 2026
@akarnokd
akarnokd merged commit a8ab535 into ReactiveX:4.x Aug 11, 2026
8 checks passed
@akarnokd
akarnokd deleted the 4xStreamableTimerTaskLeak branch August 11, 2026 11:23
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.

StreamableTimer.finish() bypasses disposal, leaving scheduled tasks running and causing thread starvation

1 participant