-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
openclaw gateway restart hangs on macOS with SMB-mounted volumes (lsof stat() timeout) #75767
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.Crash, hang, restart loop, or process-level availability failure.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.staleMarked as stale due to inactivityMarked as stale due to inactivity
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.Crash, hang, restart loop, or process-level availability failure.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.staleMarked as stale due to inactivityMarked as stale due to inactivity
Type
Fields
Priority
None yet
Description
Environment
/Volumes/.timemachine/DS224plus._smb._tcp.local./.../Mac_backupSymptoms
Running
openclaw gateway restartoropenclaw gateway --forcecauses the process to hang for extended periods (30s to minutes). During the hang, the following warning repeats many times:Eventually it either times out or fails with:
Root Cause Analysis
OpenClaw's port-checking logic uses
lsofin 4 separate call sites across 3 files:ports-bfXSW6vy.jsreadUnixListenersrunCommandWithTimeoutports-CUmvj7Fu.jslistPortListenersexecFileSync(used by--force)restart-stale-pids-*.jsfindGatewayPidsOnPortSyncspawnSyncrestart-stale-pids-*.jspollPortOncespawnSyncThe command used is:
lsof -nP -iTCP:{port} -sTCP:LISTEN -FpFc[n]On macOS,
lsoftraverses all mounted filesystems to build its file descriptor table, even when the-iflag limits results to a single network port. When an SMB/NFS mount is unresponsive (e.g., NAS is busy with Time Machine backup, network congestion, disk sleep wake-up),lsofblocks for the SMB timeout (10-30s+) on eachstat()call.This affects every CLI operation that needs to inspect port 18789, causing the Gateway restart sequence to feel like it takes "10+ minutes" as it goes through multiple retry/timeout cycles.
Attempted workaround:
-bflagThe
lsof -bflag (which skips blocking kernel calls likestat(),readlink()) was tested but does not resolve the issue — macOSlsofstill traverses SMB mounts at the VFS layer regardless of-b.Proposed fix
Replace
lsof-based port checking with a pure Node.js approach:This would be immune to filesystem mount issues and also faster than spawning
lsof.Alternatively, at minimum, the
readUnixListenersasync code path already has ass(socket statistics) fallback — extending this to the sync paths or making the sync paths async could help.