martha#329: two installs that race at the swap both end well #341

Manually merged
terra merged 3 commits from saturnus/329-install-race into main 2026-12-01 08:51:23 +00:00
Member

Refs #329

Two martha up runs that install Martha's own Claude Code at once raced at the folder swap. The second run's renameSync found the folder the first had just placed and threw ENOTEMPTY, uncaught.

  • The rename now goes first. A folder already there that holds the binary is a checked install, so it is kept and never pulled from under a member the first run may start.
  • A broken folder (no binary) is removed and the rename tried once more. A second loss returns a plain line naming the command to run again.
  • Tests: two real installs interleaved through a stand-in npm (the first runs whole inside the second's npm step; no outside call), and a broken folder replaced. 4 mutants on the guard, all caught.
Refs #329 Two `martha up` runs that install Martha's own Claude Code at once raced at the folder swap. The second run's `renameSync` found the folder the first had just placed and threw ENOTEMPTY, uncaught. - The rename now goes first. A folder already there that holds the binary is a checked install, so it is kept and never pulled from under a member the first run may start. - A broken folder (no binary) is removed and the rename tried once more. A second loss returns a plain line naming the command to run again. - Tests: two real installs interleaved through a stand-in npm (the first runs whole inside the second's npm step; no outside call), and a broken folder replaced. 4 mutants on the guard, all caught.
The second run's rename found the folder the first had just placed and threw
ENOTEMPTY, uncaught. The rename now goes first: a folder already there that holds
the binary is a checked install and is kept, never pulled from under a member;
a broken one is removed and the rename tried once more, and a second loss is a
plain line. Tests: two real installs interleaved through a stand-in npm (no
outside call), and a broken folder replaced.
terra manually merged commit 60ce2063a6 into main 2026-12-01 08:51:23 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
martha-ai/martha!341
No description provided.