Skip to content

feat(moq-relay): make /health a plain liveness probe, drop sysinfo#1746

Merged
kixelated merged 3 commits into
mainfrom
claude/sweet-shaw-7d1d71
Jun 15, 2026
Merged

feat(moq-relay): make /health a plain liveness probe, drop sysinfo#1746
kixelated merged 3 commits into
mainfrom
claude/sweet-shaw-7d1d71

Conversation

@kixelated

Copy link
Copy Markdown
Collaborator

Summary

The relay's /health endpoint had grown into a host overload monitor: in-process CPU/RAM/network/load-average thresholds (sampled via the sysinfo crate) plus an external --web-health-api deferral, all returning 503 when a threshold was breached.

Host health monitoring belongs in a separate process that watches the host, not in the relay, and the thresholds were going unused. This reverts that surface:

  • /health is now a pure liveness probe that always returns 200 ok (unauthenticated, so load-balancer probes don't need a JWT).
  • Removed all --web-health-* CLI flags, MOQ_WEB_HEALTH_* env vars, and [web.health] TOML keys.
  • Deleted the public HealthConfig, Health, MemLimit, and LoadLimit types (src/health.rs, ~684 lines).

MSRV

sysinfo 0.39 relies on std's cfg_select!, stabilized in Rust 1.95, which had forced moq-relay to override the workspace MSRV with rust-version = "1.95". Dropping sysinfo lets the crate return to rust-version.workspace = true (1.85), matching every other crate in the workspace.

Files

  • src/health.rs deleted; wiring removed from web.rs, main.rs, lib.rs, and the TOML-clobber regression test in config.rs.
  • Cargo.toml: dropped sysinfo, reverted the MSRV override. reqwest/url/wiremock/serde_with are retained (used elsewhere).
  • Docs: doc/bin/relay/config.md drops the [web.health] section; doc/bin/relay/http.md documents the liveness probe and points host monitoring at a separate process.

Public API note

This removes public items (HealthConfig, Health, MemLimit, LoadLimit) and CLI flags from moq-relay. Targeting main rather than dev: this isn't a wire-protocol change nor one of the consumed-library APIs the branch-targeting rules route to dev, and the relay has no external consumers yet (breaking relay changes are treated as patch bumps).

Version

0.12.9 is already released, so this lands in [Unreleased]. The version bump + changelog are left to release-plz rather than hand-edited.

Test plan

  • cargo build -p moq-relay
  • cargo clippy -p moq-relay --all-targets
  • cargo test -p moq-relay (119 unit + 3 smoke, including health_endpoint_reports_ok)
  • cargo fmt -p moq-relay -- --check

(Written by Claude)

The `/health` endpoint grew in-process host overload checks (CPU, RAM,
network, load average) backed by the sysinfo crate, plus an external
`--web-health-api` deferral. Host health monitoring belongs in a separate
process that watches the host, not in the relay, and the thresholds went
unused.

Reduce `/health` to a pure liveness probe that always returns 200 ok, and
remove all `--web-health-*` flags, env vars, and TOML keys along with the
`HealthConfig`/`Health`/`MemLimit`/`LoadLimit` types.

Dropping sysinfo 0.39 also drops the crate's 1.95 MSRV bump (it needed
std's `cfg_select!`); moq-relay returns to the workspace MSRV of 1.85.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 142f1f26-fee7-446b-8a81-7c0fed0372ef

📥 Commits

Reviewing files that changed from the base of the PR and between 8fe70ad and 79b318c.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • rs/moq-relay/CHANGELOG.md
  • rs/moq-relay/Cargo.toml
✅ Files skipped from review due to trivial changes (1)
  • rs/moq-relay/CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • rs/moq-relay/Cargo.toml

Walkthrough

The pull request removes the load-shedding health monitoring system from moq-relay. The deleted health.rs contained HealthConfig, Health, MemLimit, Rate, and LoadLimit types that sampled CPU, RAM, network, and system load, then returned 503 responses when thresholds were breached. WebConfig and WebState lose their health fields, serve_health becomes a zero-argument handler that always returns 200 ok\n, and the main function no longer builds a health monitor for WebState. The sysinfo dependency is removed from Cargo.toml, the associated regression test is deleted, the smoke test helper is updated, and both config.md and http.md are revised to reflect the simplified endpoint. Version bumps to 0.12.10 and rust-version switches to workspace-inherited.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: converting /health to a liveness probe and removing the sysinfo dependency.
Description check ✅ Passed The description thoroughly explains the rationale, changes, and impact of simplifying /health from a host overload monitor to a liveness probe.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch claude/sweet-shaw-7d1d71

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@doc/bin/relay/http.md`:
- Around line 82-89: The documentation for the `/health` endpoint describes the
response body as `ok`, but the actual implementation in rs/moq-relay/src/web.rs
(Line 385) and the smoke test in rs/moq-relay/tests/smoke.rs (Line 269) validate
that the response body is `ok\n` with a trailing newline. Update the
documentation example and description in the `/health` section to explicitly
show the newline character in the response body (change `ok` to `ok\n`) to
accurately reflect the actual API behavior and prevent confusion.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 558a609e-b1d6-4ca8-a0f9-cacb8630cc17

📥 Commits

Reviewing files that changed from the base of the PR and between 06b306d and f626725.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (9)
  • doc/bin/relay/config.md
  • doc/bin/relay/http.md
  • rs/moq-relay/Cargo.toml
  • rs/moq-relay/src/config.rs
  • rs/moq-relay/src/health.rs
  • rs/moq-relay/src/lib.rs
  • rs/moq-relay/src/main.rs
  • rs/moq-relay/src/web.rs
  • rs/moq-relay/tests/smoke.rs
💤 Files with no reviewable changes (5)
  • rs/moq-relay/src/main.rs
  • doc/bin/relay/config.md
  • rs/moq-relay/src/health.rs
  • rs/moq-relay/src/lib.rs
  • rs/moq-relay/src/config.rs

Comment thread doc/bin/relay/http.md
kixelated and others added 2 commits June 15, 2026 15:44
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Patch bump for the /health simplification. Per the relay's semver policy
(no external consumers yet) breaking relay changes are released as patch
bumps rather than a minor/major upgrade.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@kixelated
kixelated enabled auto-merge (squash) June 15, 2026 23:35
@kixelated
kixelated merged commit c924280 into main Jun 15, 2026
1 check passed
@kixelated
kixelated deleted the claude/sweet-shaw-7d1d71 branch June 15, 2026 23:49
@moq-bot moq-bot Bot mentioned this pull request Jun 16, 2026
@kixelated kixelated mentioned this pull request Jun 16, 2026
5 tasks
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