Skip to content

Add opt-in startup health state foundation - #540

Open
JusterZhu wants to merge 2 commits into
masterfrom
justerzhu-startup-health-confirmation
Open

JusterZhu wants to merge 2 commits into
masterfrom
justerzhu-startup-health-confirmation

Conversation

@JusterZhu

Copy link
Copy Markdown
Collaborator

Summary

  • Add an opt-in, persistent startup-attempt store with explicit health confirmation, failure and process-exit outcomes, and deadline enforcement.
  • Serialize competing processes with an OS-released lock and atomically publish terminal outcomes; preserve existing update and rollback behavior.
  • Document integration boundaries and exercise contention, crash recovery, interrupted writes, and timeout behavior.

Validation

  • dotnet test tests\CoreTest\CoreTest.csproj --filter "FullyQualifiedName~StartupHealthStoreTests|FullyQualifiedName~BackupRestoreTests" — 17 passed.
  • dotnet build src\GeneralUpdate.Core\GeneralUpdate.Core.csproj --no-restore — all target frameworks built, with existing warnings.
  • Native AOT publishing was attempted, but could not link: this environment lacks the Visual C++ platform linker. No Native AOT runtime claim is made.

Scope and follow-up

This does not wire startup monitoring into the updater or Bowl and does not execute rollback. End-to-end recovery needs a shared host contract, an agreed single rollback owner, exact backup identity, durable idempotent interrupted-rollback recovery, and coordinated manifest/reporting changes. Process liveness is not a health confirmation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 22, 2026 15:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The documentation incorrectly implies that a false return means no outcome was recorded, although an expired attempt can be recorded as TimedOut, potentially misleading hosts about whether the attempt changed.

1 open issue
What changed in this PR

Adds an opt-in startup health store to GeneralUpdate.Core, providing persistent startup outcomes without changing the update pipeline or implementing rollback.

Changes:

  • Adds explicit health confirmation, failure and process-exit outcomes, and deadline enforcement.
  • Uses per-attempt locking and atomic file publication, with tests for persistence, contention, crash recovery, and interrupted writes.
  • Documents host responsibilities, storage constraints, and future integration boundaries.
File Description
tests/​StartupHealthProbe/​StartupHealthProbe.csproj Defines the cross-process test helper project.
tests/​StartupHealthProbe/​Program.cs Provides outcome-reporting and lock-holding probe operations.
tests/​CoreTest/​StartupHealth/​StartupHealthStoreTests.cs Tests terminal outcomes, deadlines, corruption, and process recovery.
tests/​CoreTest/​CoreTest.csproj Adds the probe as a build dependency.
src/​GeneralUpdate.Core/​StartupHealth/​StartupHealthStore.cs Implements persistent attempts, locking, and terminal transitions.
src/​GeneralUpdate.Core/​StartupHealth/​StartupHealthStatus.cs Defines pending and terminal startup states.
docs/​startup-health-store.md Explains usage, guarantees, and integration boundaries.

Review effort: Balanced

Comment on lines +10 to +11
overwritten; a `false` return means no new outcome was recorded, so read the
status to distinguish a retry from a conflicting outcome.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

2 participants