fix(executor): ignore recurring TimeoutJobs in is_empty#4956
fix(executor): ignore recurring TimeoutJobs in is_empty#4956ashnaaseth2325-oss wants to merge 1 commit intoboa-dev:mainfrom
Conversation
Signed-off-by: ashnaaseth2325-oss <ashnaaseth2325@gmail.com>
|
This was the old behaviour, but it was patched up in #4891 to return to blocking if timeout jobs are still pending. It's much easier to maintain vs having to check all edge cases of termination. |
Test262 conformance changes
Broken tests (3):Tested main commit: |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4956 +/- ##
===========================================
+ Coverage 47.24% 57.81% +10.56%
===========================================
Files 476 557 +81
Lines 46892 61061 +14169
===========================================
+ Hits 22154 35302 +13148
- Misses 24738 25759 +1021 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thanks for the clarification! |
Summary
This PR fixes an issue where
SimpleJobExecutorcould fail to terminate whensetIntervalis active.Previously,
SimpleJobExecutor::is_empty()only checked whether thetimeout_jobsmap itself was empty:Because
setIntervalcontinuously schedules newTimeoutJobs, the queue never became empty. As a result, the executor always believed work was pending andrun_jobs()could never exit.However,
TimeoutJobalready exposes arecurringflag intended to indicate jobs that should not block executor termination.Fix
Two small adjustments connect the existing design to the executor logic.
First, the executor now ignores recurring timeout jobs when determining completion:
Second, the initial interval scheduling now uses
TimeoutJob::recurringto ensure consistent behavior with later reschedules.Result
run_jobs()now exits correctly once all finite (non-recurring) work has completed, whilesetIntervalcontinues to function normally.