Commit 5dad918
卧龙
fix: prevent event loop saturation from trajectory flush
Three changes to prevent the trajectory flush from blocking the
event loop for 25+ minutes under heavy session load:
1. queued-file-writer: yield event loop via setImmediate between
each queued write to prevent the promise chain from consuming
100% of the event loop. Without this yield, 700+ queued writes
(50MB trajectory) block the event loop continuously.
2. trajectory paths: reduce TRAJECTORY_RUNTIME_FILE_MAX_BYTES from
50MB to 10MB to prevent any single trajectory file from growing
large enough to cause multi-second flush delays.
3. run-cleanup-timeout: increase AGENT_CLEANUP_STEP_TIMEOUT_MS
from 10s to 30s to give large trajectories more time to flush
before the timeout warning fires.
Closes #758391 parent b6f9b5f commit 5dad918
3 files changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
133 | 134 | | |
134 | 135 | | |
135 | 136 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
0 commit comments