openclaw - 💡(How to fix) Fix Two issues causing persistent event loop saturation: temp file leak + node.list probe timeout [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#76047Fetched 2026-05-03 04:42:54
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
2
Timeline (top)
commented ×1cross-referenced ×1

Two related issues that together cause eventLoopUtilization=1 and cpuCoreRatio=1.5+, making the gateway unresponsive (cron tool timeouts, slow responses).

Root Cause

Two related issues that together cause eventLoopUtilization=1 and cpuCoreRatio=1.5+, making the gateway unresponsive (cron tool timeouts, slow responses).

Code Example

node.list 2059ms (repeated every ~2s)
liveness warning: eventLoopUtilization=1 cpuCoreRatio=1.546
RAW_BUFFERClick to expand / collapse

Summary

Two related issues that together cause eventLoopUtilization=1 and cpuCoreRatio=1.5+, making the gateway unresponsive (cron tool timeouts, slow responses).

Issue 1: Temp files not cleaned up after atomic writes

.tmp files accumulate indefinitely after atomic writes:

  • ~/.openclaw/devices/paired.json.*.tmp
  • ~/.openclaw/cron/jobs-state.json.*.tmp
  • ~/.openclaw/update-check.json.*.tmp

After ~2 weeks of runtime: 150+ paired.json temps, 300+ cron state temps, 67+ update-check temps. These should be deleted after the atomic rename succeeds. The accumulation causes significant I/O overhead.

Issue 2: node.list probe takes ~2 seconds per call, Control UI polls continuously

With no nodes paired, node.list still performs a 2-second probe timeout on every call. The Control UI dashboard polls this endpoint continuously via WebSocket (~every 2s).

Result: event loop is 100% utilized processing 2-second timeouts in a tight loop.

Log evidence:

node.list 2059ms (repeated every ~2s)
liveness warning: eventLoopUtilization=1 cpuCoreRatio=1.546

Suggested fixes

  1. Temp files: delete .tmp after successful rename; add startup cleanup for orphaned temps
  2. node.list: return immediately when no nodes configured, or make probe timeout configurable

Environment

  • macOS arm64, Mac mini 8GB RAM
  • OpenClaw 2026.4.29
  • No nodes paired, iMessage + WhatsApp active

extent analysis

TL;DR

Delete temporary files after successful atomic writes and optimize the node.list probe to reduce event loop utilization.

Guidance

  • Implement a mechanism to delete .tmp files after a successful atomic write, such as using a finally block to ensure cleanup regardless of the outcome.
  • Modify the node.list probe to return immediately when no nodes are configured, or make the probe timeout configurable to reduce the 2-second delay.
  • Consider adding a startup cleanup process to remove any orphaned temporary files that may have accumulated.
  • Verify the effectiveness of these changes by monitoring the event loop utilization and CPU core ratio after implementation.

Example

// Pseudocode example of deleting tmp files after atomic write
try {
  // Perform atomic write
} finally {
  // Delete tmp file
  fs.unlink(tmpFilePath, (err) => {
    if (err) {
      console.error(err);
    }
  });
}

Notes

The provided guidance assumes that the issue is primarily caused by the accumulation of temporary files and the inefficient node.list probe. However, the root cause may be more complex, and additional debugging may be necessary.

Recommendation

Apply the suggested fixes, specifically deleting temporary files after successful atomic writes and optimizing the node.list probe, as these address the primary causes of the issue and can help reduce event loop utilization and CPU core ratio.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Two issues causing persistent event loop saturation: temp file leak + node.list probe timeout [1 comments, 2 participants]