Skip to content

fix: daemon busy-wait loop causing 100% CPU usage (upstream #1052)#11

Open
blackms wants to merge 1 commit intomainfrom
codex/recreate-pr-1052-daemon-busy-wait
Open

fix: daemon busy-wait loop causing 100% CPU usage (upstream #1052)#11
blackms wants to merge 1 commit intomainfrom
codex/recreate-pr-1052-daemon-busy-wait

Conversation

@blackms
Copy link
Owner

@blackms blackms commented Feb 6, 2026

Replica upstream

Questa PR ricrea nel fork la fix upstream:

Contenuto

  • Risoluzione loop di busy-wait in worker-daemon.ts quando i worker vengono deferiti
  • Eliminazione del caso che saturava CPU al 100% e autososteneva il defer condition

Metodo

Cherry-pick del commit upstream e917e918c13893afe807e35e39b051576ca7d597 (con -x).

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)
@coderabbitai
Copy link

coderabbitai bot commented Feb 6, 2026

Warning

Rate limit exceeded

@blackms has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 25 minutes and 26 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/recreate-pr-1052-daemon-busy-wait

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Feb 6, 2026

🔗 Integration Test Results

🔗 Cross-Agent Integration Test Report

Session ID: integration-20260206-224355-04a9a42613f3bad61aeb3fa1ea6eb97179942e20
Timestamp: 2026-02-06T22:51:15.838Z
Overall Status: ✅ PASSED

Summary

  • Total Tests: 4
  • Passed: 4
  • Failed: 0
  • Success Rate: 100.0%

Test Results

Component Status Details
Agent Coordination Multi-agent communication and task distribution
Memory Integration Shared memory operations and synchronization
Fault Tolerance Failure recovery and system resilience
Performance Multi-agent performance and scalability

Recommendations

  • All integration tests passed successfully!

Next Steps

  1. Review detailed test artifacts
  2. Address any failed test scenarios
  3. Monitor integration performance in production

Generated by Cross-Agent Integration Test Pipeline

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants