hashgraph / hashgraph/solo-weaver
Story: Self-upgrade CLI-child health-check loop on daemon.sock (HIP step 3h)
- Dominant language
- Go
- Stars
- 3
- Forks
- 0
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 47
Description
Part of epic #500 — Self-Upgrade Protocol. Implements HIP XXXX2 self-upgrade **step 3h** (CLI-child health-check loop), which is currently unowned.
## Context
After the detached child stops the old daemon and starts the new one (steps 3f–g), it must confirm the **new** daemon is actually healthy before declaring success. This is the decision point between the success path (step 3i) and automatic recovery (step 3j, #528).
Note: this is distinct from #527 (CLOSED), which implemented the **daemon-side** `sd_notify(READY=1)` readiness signal. This story is the **CLI-child-side** poll loop that consumes that readiness.
## Scope
- Poll `GET /health` on the daemon's Unix domain socket `/opt/solo/weaver/daemon/daemon.sock`.
- Retry with a configurable timeout (HIP default: **120s**).
- **Healthy within timeout →** hand off to the success path (#526/#529: state `succeeded`, clean `.bak`, exit 0).
- **Not healthy after timeout →** hand off to the automatic-recovery path (#528).
- errorx-based error wrapping; structured journald + JSONL logging of each poll outcome.
## Acceptance criteria
- Returns healthy as soon as `/health` succeeds; does not wait out the full timeout.
- On timeout, triggers recovery (#528) rather than reporting success.
- Timeout is configurable; default 120s matches HIP.
- Unit test: socket-up → success; socket-never-ready → recovery handoff.
## Dependencies
- Daemon `/health` endpoint over `daemon.sock`.
- Feeds #528 (recovery) and #526/#529 (success path).
Contributor guide
Research direction
The issue names no implementation files or entry points; start by tracing the self-upgrade CLI-child flow for steps 3f–3j and the client handling GET /health on /opt/solo/weaver/daemon/daemon.sock. Verify how #526/#529 and #528 are invoked, then add tests for socket-up success and socket-never-ready recovery with the configurable 120s default.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend-api-design, cli, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 54/100