fix(cron): respect per-job timeoutSeconds in executeJob path (#16841)#16880
Closed
echoVic wants to merge 2 commits intoopenclaw:mainfrom
Closed
fix(cron): respect per-job timeoutSeconds in executeJob path (#16841)#16880echoVic wants to merge 2 commits intoopenclaw:mainfrom
echoVic wants to merge 2 commits intoopenclaw:mainfrom
Conversation
bfc1ccb to
f92900f
Compare
…w#16841) The executeJob function (used for missed-job recovery, runDueJobs, and manual/forced runs) called executeJobCore without any timeout wrapper, unlike the onTimer batch path which correctly used Promise.race with payload.timeoutSeconds. This meant jobs running through executeJob relied solely on the inner agent timeout from resolveAgentTimeoutMs (which defaults to the config value agents.defaults.timeoutSeconds), ignoring the per-job payload.timeoutSeconds override. Add the same Promise.race timeout to executeJob, reading payload.timeoutSeconds with DEFAULT_JOB_TIMEOUT_MS (10 min) as fallback, matching the existing onTimer behavior. Closes openclaw#16841
Contributor
Author
|
Friendly ping 👋 — CI is green, would appreciate a review when you get a chance. Thanks! |
18 tasks
Contributor
|
Closing as superseded by newer merged cron timeout work in #22411 and existing mainline timeout coverage. The executeJob path now uses executeJobCoreWithTimeout (see src/cron/service/ops.ts), so this PR is no longer needed. |
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
Fixes #16841
The
executeJobfunction (used for missed-job recovery,runDueJobs, and manual/forced runs viaops.ts) calledexecuteJobCoredirectly without any timeout wrapper. Unlike theonTimerbatch path which correctly usedPromise.racewithpayload.timeoutSeconds, jobs running throughexecuteJobrelied solely on the inner agent timeout fromresolveAgentTimeoutMs, which defaults tocfg.agents.defaults.timeoutSecondsand ignores the per-jobpayload.timeoutSecondsoverride.Changes
Added the same
Promise.racetimeout wrapper toexecuteJob, readingpayload.timeoutSecondsfrom the job config withDEFAULT_JOB_TIMEOUT_MS(10 min) as the fallback — matching the existingonTimerbehavior.Testing
service.issue-regressions,service.rearm-timer-when-running)Greptile Summary
Adds
Promise.racetimeout wrapper to theexecuteJobfunction to respect per-jobtimeoutSecondsconfiguration. Previously, jobs executed viaexecuteJob(used for missed-job recovery, manual runs, and forced execution) bypassed the job-level timeout and relied only on the inner agent timeout. This change mirrors the existing timeout logic inonTimer(lines 230-245), applying the samejobTimeoutMscalculation andPromise.racepattern with proper timeout cleanup.Confidence Score: 5/5
onTimer(lines 230-245), uses the same timeout calculation logic, includes proper cleanup via.finally(), and maintains consistency across both execution paths. The change is minimal, focused, and directly addresses the documented issue.Last reviewed commit: d29fc2c