GPT-5 finding
Synchronous child_process calls in API handlers block the event loop
mediumperformancehigh
- dashboard/app/api/analytics/route.ts:55-60
- dashboard/app/api/runs/[id]/logs/route.ts:39-45
- dashboard/app/api/runs/[id]/logs/route.ts:49-56
- dashboard/app/api/runs/route.ts:26-31
execFileSync/execSync are used in request handlers, which blocks Node’s event loop and reduces concurrency under load. This is particularly risky when combined with larger maxBuffer and long timeouts.
Recommendation
Switch to non-blocking execFile/spawn wrapped in Promises, or offload to a worker/queue. Consider caching results and adding request-level timeouts and rate limits to mitigate load.