fix(pi): clear watcher shutdown latch on session_start (/new)#976
Open
moj02090 wants to merge 3 commits into
Open
fix(pi): clear watcher shutdown latch on session_start (/new)#976moj02090 wants to merge 3 commits into
moj02090 wants to merge 3 commits into
Conversation
added 3 commits
July 24, 2026 13:39
/new keeps the same Pi process and loaded extension module. session_shutdown sets the process-local stopping latch, and the old session_start path never cleared it, so later arms stuck on "Pi session is shutting down". Clear the latch on session_start, restore the process-exit fallback, and quietly re-arm when this session already owns the lock.
Author
|
hmm I used no mistakes? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes Pi
/newleaving the primary watcher stuck onwatcher: not armed - Pi session is shutting down.Root cause
.pi/extensions/fm-primary-pi-watch.tssets a module-scopestoppinglatch instopArm()onsession_shutdown/ process exit./newkeeps the same Pi process and loaded extension module, so the oldsession_startpath (onlymarkLoaded()) never cleared that latch. Every later arm refused with the shutdown message.Fix
On
session_start:stopping = falseretryFailures/retryTimermarkLoaded()as beforestartArm()when this session already owns the lock and nothing is armedReview follow-ups on the same branch also:
restoreAfterActionableClosework across session boundaries before reopening the latchsessionGenerationand ignore delayed close events from a pre-/newchildScope
Pure upstream fix only (extension + docs note + tests). No ADO forge-adaptation commits.
Test plan
tests/fm-pi-watch-extension.test.sh— session_start clears shutdown latch and quiet-rearmsPipeline
Updates from git push no-mistakes