Repository navigation
Conversation
…play-null failures
…ready-check-hysteresis # Conflicts: # projects/start-sdk/lib/mainFn/HealthDaemon.ts # projects/start-sdk/lib/test/DaemonLifecycle.test.ts
MattDHill
left a comment
There was a problem hiding this comment.
The core change is sound: crash, exit, start-failure and upstream-loss still pause dependents immediately, the probeEpoch guards hold, runUntilSuccess stays strict, and catching effects.setHealth rejections fixes a real bug (one rejection ended the health loop on master). The DaemonLifecycle, health, trigger and Daemons suites pass, 125/125. One change before merge:
The threshold counts polls, not time, and covers every non-success result (HealthDaemon.ts, setHealth / READY_FAILURE_THRESHOLD = 3). Under defaultTrigger, loading and disabled poll every 30 s, so a dependency that reports loading after succeeding keeps its dependents up for about 60 s, and a check on cooldownTrigger(60_000) tolerates 2–3 minutes of failure. The ~2 s blip tolerance this is after only holds for failure/starting at the default 1 s retry, and a daemon that deliberately reports loading isn't a blip. Please limit the tolerance to failure (or failure/starting), or bound it by elapsed time, and have the fragment say which applies.
Also:
- This changes what
requiresmeans for every package (dependents keep running against a failing dependency for a while), so it needs a maintainer's sign-off on the design. - Nit: the fragment's third bullet ("instead of stopping health checks") describes the old behavior.
- Heads-up: conflicts with #4848 in
DaemonLifecycle.test.ts.
helix-white
left a comment
There was a problem hiding this comment.
Requesting changes on 62d25cd8792c4fa2aea86f8ed8238a873d150f77.
[P2] Restrict transient tolerance to failure results — projects/start-sdk/lib/mainFn/HealthDaemon.ts, setHealth(). I agree with Matt's finding: the counter also tolerates loading, disabled, and starting. After a successful check, disabled therefore leaves dependent processes running, and loading under defaultTrigger takes another ~60 seconds to pause them. Those are explicit non-ready states, not necessarily failed-probe blips.
The proposal takes the failure-only alternative Matt offered:
- Preserve the three-poll threshold for
failure; pause immediately on other non-success results. - Extend the raw-watcher regression to cover
loading,disabled, and both forms ofstarting, including recovery after the pause. - Record the readiness contract in the exported
Readydocumentation and packaging guide, and make the fragment explicitly poll-count based. Slower custom triggers or checks can still extend failure tolerance; this is not a wall-clock deadline. - Correct the fragment's throw-handling wording and remove the stale cadence summary beside
Ready.
Maintainer sign-off on the changed requires semantics is still needed. I found no additional independent correctness regression in the lifecycle/probe invalidation paths.
Proposed changes: 62d25cd...proposal/4853
The reviewed head merges cleanly with current master (c6eb52a7f). Static review only: the proposal's tests and checks have not been run. The current PR checks are metadata-only.
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
Helix-Harness: pi Helix-Model: openai-codex/gpt-6.1-sol
|
Note 🤖 Gemini 4 Neon responding on behalf of Victor Adopted |
Problem
In
HealthDaemon, a single non-successready-check poll on a required daemon (probe timeout or thrownexec) immediately paused every dependent viachangeRunning(false):SIGTERM, drain, and relaunch. On slow hosts under boot load, one probe blip tore dependents down mid-boot in a loop while the required daemon stayed healthy.setHealth()also returned beforeconsole.errorwhendisplaywasnull, leaving dependency-driven pauses unlogged.Fixes #3803.
Change
dependentsReadyseparately from raw_health(addWatcher()still fires on raw changes). Aftersuccess, dependents tolerate 2 consecutivefailurepolls (READY_FAILURE_THRESHOLD = 3, poll-count based;successresets);loading,disabled, andstartingpause immediately.onExit), failedstart(), upstream dependency loss, terminalstatusTrigger(..., { <status>: Infinity })statuses, or a trigger that ends or throws with a failure pending.probeEpochacross session resets, exits, and upstream loss, and drop late results from probes whose session a non-blocking stop aborted; catcheffects.setHealth()rejections and keep lifecycle order across late health writes; keepDaemons.runUntilSuccess()on strict rawsuccess.Errorvalues (including unstringifiable objects) fromready.fn()and custom triggers without stopping polling or breakingterm().Health Check <id> failed:afterwithGracePeriod()fordisplay: nullchecks, still skippingeffects.setHealth();EXIT_SUCCESSis unchanged.Verification
All checks below were executed by an AI agent.
distreproduction (Daemons.of,postgreswithdisplay: null, dependentimmich-server):bf3c13a23): exited 1; 1 failed poll pausedimmich-serverwith 0 failure logs, and 1 thrown check paused it again with 0 logs.0518fa0cc): exited 0; both blips loggedHealth Check postgres failed:without pausingimmich-server, 3 failures paused it, recovery resumed it,loading/disabled/startingandSIGSEGVpaused it immediately.DaemonLifecycle.test.ts(6dc9c6746vse91471094): 12/18 new tests fail; 6 guard unchanged behavior. A 19th test covers a hungready.fn(signal)across pause, resume, and active hysteresis.0518fa0cc(adoptedproposal/4853b16e85d0e; 4/4 new non-failure tests fail on62d25cd87):make start-sdk-test(542/542 core, 63/63 scripts, 440/440 Jest, 2/2 docs),sdk check/bundle,container-runtime-test(39/39),release-notes-test(201/201),check-version, and Prettier 3.8.3 passed.Not checked
model: gemini-4-neon, gpt-6.1-sol
Generated with Gemini 4 Neon in T3 Code Nightly
review effort: 'xhigh'