Skip to content

Validate process generation before watcher publication - #17

Merged
4i7 merged 2 commits into
mainfrom
fix/prepublish-candidate-validation
Aug 21, 2026
Merged

4i7 merged 2 commits into
mainfrom
fix/prepublish-candidate-validation

Conversation

@4i7

@4i7 4i7 commented Aug 21, 2026

Copy link
Copy Markdown
Owner

Fixes the remaining pre-publication exit race exposed by AppInfo lifetime regressions B/J.

The process can become exited after EnableRaisingEvents succeeds while the Exited event is still pending. The previous arbitration path only checked ExitObserved before publishing when no winner existed, so an already-exited candidate could briefly be returned as Watching.

Changes:

  • run GetUnpublishedCandidateState(data) at the start of every publication-arbitration iteration
  • return AlreadyExited for a definite exited candidate and Unavailable for an unverifiable candidate before publication
  • preserve the existing ExitObserved lock recheck, winner generation validation, and exact winner transfer checks
  • apply the identical runtime implementation in tools/Optimize-MyMix/15-process-watcher-lifecycle.ps1
  • leave Test-AppInfoCacheLifetime.ps1 unchanged; B/J remain the regression gate for this behavior

This keeps the intended invariant: an unpublished candidate must be validated as Current before it can become the published watcher.

@4i7
4i7 merged commit 4e4ae3c into main Aug 21, 2026
2 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