Skip to content

fix: prevent monitor shutdown deadlock (2.1.1) - #52

Merged
jakezwang merged 1 commit into
masterfrom
codex/monitor-shutdown-2-1-1
Sep 7, 2026
Merged

jakezwang merged 1 commit into
masterfrom
codex/monitor-shutdown-2-1-1

Conversation

@jakezwang

@jakezwang jakezwang commented Sep 7, 2026 •

Copy link
Copy Markdown
Collaborator

After the first 30-second monitor health tick, argon console could hang indefinitely on normal shutdown. The health loop held its mutex and called the public alert methods, which tried to acquire that same mutex. The released-binary goroutine dump confirmed Monitor.Stop waiting for that blocked loop.

Use internal alert helpers while the health loop already holds the lock, preserving locking in the public methods. Bump the shared version to 2.1.1 and update the 2.1 release notes; the published 2.1.0 tag and assets remain unchanged.

Validation: the new tests fail on the original source and pass with this patch. go test -race ./internal/wal -run TestMonitor -count=10, the complete internal WAL unit package with race detection, go vet ./internal/wal, version consistency and all six release/installer Node tests passed. Tests cover the actual ticker and Stop, default healthy checks, repeated critical failures, recovery and public alert operations. A real CLI run through the default 30-second tick (32 seconds total) then exited normally in 0.009 seconds after SIGTERM.

Remote validation: all eight checks passed on the exact PR head and again on the merge commit. PR CI, post-merge CI. 2.1.1 is now published; all five asset checksums, clean npm installation, MCP latest entry and the Homebrew source formula were verified.

@jakezwang
jakezwang merged commit 4d2f0ee into master Sep 7, 2026
8 checks passed
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.

1 participant