gw#613/th#965: universal app-level heartbeat — 0.41.0#362
Merged
Conversation
… liveness contract (0.41.0) Hello declares heartbeat_interval_ms=30000; the pgw#610 disk-report task is promoted to the beat: it force-re-sends the full StateDelta every 30s from the asyncio event loop (the control loop that owes progress, never a detached thread), starts at startup() entry so boot hangs are covered, and keeps beating through drain until the stream closes. Edge-triggered deltas still flow as before; the beat is the same message re-sent unchanged. Contract §3 rewritten to the 3-layer model (lockstep tensorhub c03a531d). Tests: hello cadence, force-send bypasses edge suppression, beats flow while a startup coroutine is parked (the gw#612 shape), drain keeps beating until close.
…ing every beat HEARTBEAT_INTERVAL_MS 30000 -> 10000 (hub reaps at 6 misses, ~60s). The pgw#610 statvfs/ref-index scan keeps its 30s measurement cadence behind a TTL cache so the 10s beat never turns it into a hot loop; the report still rides every StateDelta. Contract §3 event-loop discipline clause added — already true in 0.41.0: setup/warmup/compile/residency/GC all run off-loop (executor._to_thread_complete / asyncio.to_thread).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Promotes gw#613 from chaos (b256f7e + 7bb9762; version conflict resolved
0.40.7 -> 0.41.0, uv.lock re-resolved with uv lock).
Layer 2 of th#965's 3-layer liveness contract: Hello declares
heartbeat_interval_ms=10000 and the worker force-re-sends the full
StateDelta every 10s from the asyncio event loop (the pgw#610 disk-report
task promoted to the beat — never a detached thread), starting at
startup() entry and continuing through drain until the stream closes. The
hub (tensorhub PR #534, lockstep — merge in the same window) reaps after 6
consecutive misses (~60s). Disk stats ride every beat but are measured at
most every 30s behind a TTL cache. New contract §3 event-loop discipline
clause: never block the loop longer than the miss window — already true:
setup/warmup/compile/residency/GC run off-loop via _to_thread_complete /
asyncio.to_thread.
Tests: tests/test_heartbeat_gw613.py (cadence declaration, force-send
bypasses edge suppression, beats flow while a startup coroutine is parked
= the gw#612 hang shape, drain beats until close, disk TTL); full suite ex
tests/convert green on this head (437 passed / 5 skipped).
After merge: tag v0.41.0 to publish the wheel (publish.yml trusted
publishing).
🤖 Generated with Claude Code