fix: daemon busy-wait loop causing 100% CPU usage (upstream #1052)#11
fix: daemon busy-wait loop causing 100% CPU usage (upstream #1052)#11
Conversation
When a pending worker was deferred by canRunWorker() (e.g. CPU load above threshold), it was pushed back onto the pendingWorkers queue and executeWorkerWithConcurrencyControl returned null. The while loop in processPendingWorkers() immediately retried since the queue was non-empty and no workers were running, creating a tight loop that read /proc/loadavg and /proc/meminfo millions of times per second. The loop itself drove CPU to 100%, keeping load average permanently above the threshold, making it self-sustaining. Break out of the loop when a worker is deferred. The worker is already back in the queue and will be retried when the next scheduled worker completes (each worker's finally block calls processPendingWorkers). Co-Authored-By: claude-flow <ruv@ruv.net> (cherry picked from commit e917e91)
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔗 Integration Test Results🔗 Cross-Agent Integration Test ReportSession ID: integration-20260206-224355-04a9a42613f3bad61aeb3fa1ea6eb97179942e20 Summary
Test Results
Recommendations
Next Steps
Generated by Cross-Agent Integration Test Pipeline |
Replica upstream
Questa PR ricrea nel fork la fix upstream:
Contenuto
worker-daemon.tsquando i worker vengono deferitiMetodo
Cherry-pick del commit upstream
e917e918c13893afe807e35e39b051576ca7d597(con-x).