Skip to content

runtime: ride out venue outages against a grace watch deadline#514

Merged
mfw78 merged 1 commit into
dev/m1from
fix/venue-watch-grace-eviction
Jul 21, 2026
Merged

runtime: ride out venue outages against a grace watch deadline#514
mfw78 merged 1 commit into
dev/m1from
fix/venue-watch-grace-eviction

Conversation

@mfw78

@mfw78 mfw78 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

What

Refactor the venue status-watch eviction so a watch's give-up deadline refreshes only when the venue is reachable (a status() poll returned Ok, even if the body then failed to encode). A resolve() failure or an errored poll rides out against a grace window instead of burning the deadline. grace = min(2 * expiry, 24h), overridable via [limits.watch] grace_secs.

Closes #511. Also folds in the encode-failure refresh path flagged in review of #438 (the PR that added this watch machinery); no standalone issue was filed for that finding.

Stacked on #445 — its Liveness / resolve-failure machinery is what makes the resolve-fail path reachable, and the new test drives it via Liveness::mark_dead().

Why

Two paths bypassed the sole expires_at refresh, so a venue that stayed unreachable longer than the window silently lost a pending intent's watch:

The fix treats "the venue answered" as the single refresh condition, and makes eviction during an outage an explicit, bounded, configurable grace rather than a silent surprise. resolve()-fail and errored-poll behave identically (both ride out), so no per-outcome pause or absolute-age machinery is needed.

Testing

  • cargo test -p nexum-runtime — 71 host/config tests green.
  • New: grace_derives_from_expiry_and_caps_at_a_day, a_dead_venue_rides_out_without_refreshing_the_deadline, an_errored_poll_rides_out_without_refreshing_the_deadline, plus grace_secs coverage in watch_limits_parse_with_overrides.
  • cargo fmt --check and cargo clippy --all-targets --all-features -- -D warnings clean on 1.94.

AI Assistance

Design and implementation assisted by Claude.

Base automatically changed from feat/m2-adapters-in-sweeps to dev/m1 July 21, 2026 00:15
A status watch refreshes its give-up deadline only when the venue is
reachable: a status poll returned Ok, even if the body then failed to
encode. A resolve failure or an errored poll now rides out against a
grace window rather than burning the deadline, so a venue outage no
longer silently evicts a pending intent's watch mid-recovery.

grace = min(2 * expiry, 24h), overridable via [limits.watch] grace_secs.

Closes #511
Closes #438
@mfw78
mfw78 force-pushed the fix/venue-watch-grace-eviction branch from e0eac66 to 8056118 Compare July 21, 2026 00:16
@mfw78
mfw78 merged commit 1272191 into dev/m1 Jul 21, 2026
5 of 6 checks passed
@mfw78
mfw78 deleted the fix/venue-watch-grace-eviction branch July 21, 2026 00:19
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