Skip to content

Bound win-deskutils sessionDispatch child wait to 10s - #154

Merged
mikhailm-coder merged 1 commit into
masterfrom
hotfix/win-deskutils-bounded-session-wait
Aug 27, 2026
Merged

Bound win-deskutils sessionDispatch child wait to 10s#154
mikhailm-coder merged 1 commit into
masterfrom
hotfix/win-deskutils-bounded-session-wait

Conversation

@mikhailm-coder

Copy link
Copy Markdown

Why

A qa Windows device's mesh agent wedges seconds after every start: the core's idle-time poll (idle.getSecondsAllSessions(), present in the server-pushed core but not in the old frozen disk core) calls sessionDispatch() per active session, which spawns an agent.exe -b64exec helper and blocks in unbounded child.waitExit(). On that VM the helper hangs forever → the agent's single-threaded event machinery blocks → heartbeats starve → server closes the control channel (~18 min) → the agent's own reconnect dials fail at TLS while the box's network is fine. Killing the hung child just advances to the next spawn-and-wedge. Any Windows machine with a hang-prone session can hit this.

The identical fix (waitExit(10000)) has existed in the meshagent repo's modules/win-deskutils.js (and its binary-embedded blob) since April — but the server-pushed core's copy overrides the binary's at runtime, so the unbounded version is what executes post-migration.

What

One line in agents/modules_meshcore/win-deskutils.js: child.waitExit()child.waitExit(10000). On timeout the exitCode != 0 path throws and the per-session try/catch in idle_getSecondsAllSessions skips that session — the poll resolves and the agent keeps running. Precedent for bounded waits: sysinfo.js uses waitExit(2000)/waitExit(5000).

Rollout

  • Merge → latest image → dev/OSS auto-roll (keel); agents pick up the fixed core on reconnect via the standard push.
  • qa/stage/prod pin immutable tags → needs a 0.0.28 release dispatch + values bumps (qa first — the affected device is there).
  • The wedged qa VM may need its hung helper killed (or a reboot) once the qa server carries the fix, so the core push can be processed; it self-heals from there.

🤖 Generated with Claude Code

The per-session helper (agent.exe -b64exec) can hang forever on some
Windows VMs; the unbounded waitExit() then wedges the agent's event
loop — control channel starves, server disconnects, reconnects fail.
Same fix has shipped in the meshagent binary-embedded copy since April;
the server-pushed core copy overrides it at runtime, reintroducing the
hang. On timeout callers already catch and skip the session.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mikhailm-coder
mikhailm-coder enabled auto-merge (squash) August 27, 2026 19:00
@mikhailm-coder
mikhailm-coder merged commit 9f7d4e4 into master Aug 27, 2026
4 checks passed
@mikhailm-coder
mikhailm-coder deleted the hotfix/win-deskutils-bounded-session-wait branch August 27, 2026 19:45
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