Fix doctor telemetry aggregation: trust /health when telemetry DB missing, recover from backoff - #13
Conversation
…sing, recover from backoff - ingestion/poll-loop: when a service's telemetry SQLite DB is unreadable/missing but its /health probe is ok, report health "ok" (still surfacing telemetryFault) instead of force-degrading it. A healthy service no longer shows degraded just because doctor cannot open its telemetry sidecar. - supervisor: reset restart backoff / consecutiveRestartFailures when a service's probe transitions back to answering (including restartPolicy:"external" services like nectar, which doctor does not restart itself), so an observed recovery clears the give-up state instead of pinning the service as unreachable forever. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe poll loop's telemetry-fault handling now preserves coarse "ok" health when the ChangesHealth probe masking and supervisor recovery reset
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant PollLoop
participant HealthProbe
participant TelemetryDB
PollLoop->>HealthProbe: check /health
HealthProbe-->>PollLoop: probeHealthState
PollLoop->>TelemetryDB: read telemetry data
TelemetryDB-->>PollLoop: fault (missing/malformed/mismatch)
alt probeHealthState is ok
PollLoop->>PollLoop: keep health "ok", null metrics/deeplake, set telemetryFault
else probe degraded/unreachable
PollLoop->>PollLoop: health=probe state, fallback to last-known values
end
sequenceDiagram
participant Supervisor
participant PersistedState
participant RemediationRung
Supervisor->>PersistedState: read lastKnownHealth, backoff, restart failures
alt unreachable to degraded transition
Supervisor->>PersistedState: reset counters, rung=1, lastKnownHealth=degraded
Supervisor->>Supervisor: log tick.reachable_again, skip remediation
else no recovery transition
Supervisor->>RemediationRung: run normal remediation
end
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Why
Doctor relays the fleet health Hive renders. Two bugs made healthy services look broken: (1) when a service's telemetry SQLite DB was missing/unreadable but its
/healthprobe was ok, doctor force-degraded it (→ honeycomb "degraded" whenever it wrote telemetry to a path doctor couldn't find); (2) a service that hit the restart give-up threshold stayed pinnedunreachableeven after it recovered — fatal forrestartPolicy:"external"services (nectar) that doctor never restarts itself.What
ingestion/poll-loop: on a telemetry-DB fault with a healthy/health, reportokand still surfacetelemetryFault; a failing probe is unchanged.supervisor: reset backoff /consecutiveRestartFailureson an observed transition back to answering (including external-policy services), then remediate fresh from rung 1 if still degraded.Tests
npm run cigreen: 807 tests. Updatedpoll-looptests; newsupervisorFIX-B block.🤖 Generated with Claude Code
Summary by CodeRabbit