-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fix pendingTasks accounting if TimedRunnable disposed before scheduling #3780
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Thanks :) Please rebase to target the 3.5.x branch and we can merge.
647eefb
to
5736c7f
Compare
@chemicL I think I've rebased correctly and targeting 3.5.x branch now as requested. |
Thank you for the contribution @kkondratov! Great job and please consider contributing in the future :) 🚀 |
Please note the new tests failed when the target branch CI job was run: https://github.com/reactor/reactor-core/actions/runs/8643683792/job/23697225902 I corrected the flakiness of the tests in d11ea71 – please have a look. The tests assumed that active and pending are both equal to 1 when one task is able to run and the other should be waiting. However a situation can happen in which the Runnable is not yet being executed and has not yet decremented the pending counter. |
There are other issues of such nature in that test class, e.g. ignoring the result of |
Addresses the issue with TimedScheduler pending task leaks as described in #3697
The chosen approach splits existing TimedRunnable into two implementations and moves code from the TimedScheduler into the TimedRunnable to reduce duplication.
Two implementations
WorkerBacked/SchedulerBackedTimedRunnable
are present to differentiate between scheduler or a worker that schedules a task (since there is no shared interface between those).Differentiating from the initial proposed in #3697 by @nathankooij there is no extra objects being created and the scheduling is delegated to TimedRunnable.
Fixes #3697