Skip to content

fix(ensure-monk-agent): add 60s timeout to POSIX install lock (#413) - #495

Open
ZacLou wants to merge 1 commit into
monk-io:mainfrom
ZacLou:fix/install-lock-timeout-413
Open

fix(ensure-monk-agent): add 60s timeout to POSIX install lock (#413)#495
ZacLou wants to merge 1 commit into
monk-io:mainfrom
ZacLou:fix/install-lock-timeout-413

Conversation

@ZacLou

@ZacLou ZacLou commented Sep 6, 2026

Copy link
Copy Markdown

Closes #413.

When another monk-agent install holds the flock-backed install lock, ensure-monk-agent.sh previously waited indefinitely. This changes the blocking wait to a 60-second timeout, prints a clear error, and exits non-zero if the lock is still held.

No behavior changes for the uncontended path: the fast-path flock -n remains unchanged.

Validation

  • Added tests/ensure-monk-agent-lock-timeout.sh.
  • The test injects a deterministic fake flock so the real 60-second wait is not charged to CI.
  • Verified locally with Git Bash: the script exits 1, prints the timeout message, does not continue past the lock, and finishes in under 5 seconds.
  • Wired the test into the Unix Install E2E workflow.

…o#413)

When another monk-agent install holds the flock-backed install lock,
�nsure-monk-agent.sh previously waited indefinitely. This caused the
bootstrap to hang forever if the lock holder crashed or was wedged.

Now the blocking flock call uses a 60-second watchdog. If the lock is
still held after that, the script prints a clear error and exits
non-zero instead of hanging.

Closes monk-io#413.
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.

[Bug bounty] POSIX installer can wait forever on a wedged install lock

2 participants