fix(runners): keep track of pending actions #5038
Open
+7
−19
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.
Runner idling logic depends on keeping track of ongoing task executions.
We used to not keep track of actions, relying on the fact that actions are usually short running and runner idling time was 24h
We recently dropped the idling time to 30mins which made it possible for runners doing only actions to always idle after 30mins, requiring a cold start.
This commit modifies the tasks tracking logic on runner, tracking all pending tasks (including actions). It is gonna increase the memory consumption of actions heavy runners but will make the idling logic less brittle and timing dependent
Track all pending tasks in runner to fix premature idle
The PR updates the runner’s task-tracking logic so that every task (including short-lived actions) is stored in the
RunnerMonitor’s map. Earlier, only sync jobs were tracked viasyncJobId; as a result, a runner processing only actions could appear idle and be shut down after the new 30-minute idle threshold. The change switches the map key totaskId, updates the relatedtrack/untrackmethods, and adjusts all call sites.Key Changes
• Changed
RunnerMonitor.trackedmap key type fromnumber(syncJobId) tostring(taskId)• Replaced methods
untrackByTaskId()anduntrack(nangoProps)with unifieduntrack(taskId)• Updated call sites in
abort.tsandserver.tsto use newusage.untrack(taskId)API• Added TODO comment in
monitor.tsabout Render-specific memory monitoring• Removed dead code related to
untrackByTaskIdand simplified tracking logicAffected Areas
•
packages/runner/lib/monitor.ts•
packages/runner/lib/abort.ts•
packages/runner/lib/server.tsThis summary was automatically generated by @propel-code-bot