-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
Bug: agent-job agentRunCache grows unbounded under sustained run fan-out #77976
Copy link
Copy link
Closed
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.Crash, hang, restart loop, or process-level availability failure.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.Crash, hang, restart loop, or process-level availability failure.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.
Type
Fields
Priority
None yet
Problem
src/gateway/server-methods/agent-job.tskeeps an in-processagentRunCache: Map<runId, AgentRunSnapshot>populated by every terminal lifecycle event. There is a 10-minute TTL pruned on everysetviapruneAgentRunCache, but no max-size cap.Under sustained subagent fan-out (lots of
agent.runlifecycle traffic), the snapshot map grows in lockstep with run rate up to "all runs in the last 10 minutes" before TTL prune can bound it. Same shape as the Discord REST entity cache leak (#77975).Sibling Maps in this file (
agentRunStarts,agentRunWaiterCounts,pendingAgentRunErrors,pendingAgentRunTimeouts) are already lifecycle-bound; only the terminal-snapshot cache lacks a hard cap.Tracking PR
Fix in #77973.