fix(swarm-coordination-registry): [#2226] recompute inactivity cutoff per tick - #2250
josecelano wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2250 +/- ##
===========================================
+ Coverage 85.48% 85.79% +0.30%
===========================================
Files 353 353
Lines 31321 31336 +15
Branches 31321 31336 +15
===========================================
+ Hits 26776 26885 +109
+ Misses 4166 4073 -93
+ Partials 379 378 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Superseded by #2252, which uses the correctly aligned branch 2226-fix-stale-inactivity-cutoff. |
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Pull request overview
This PR fixes stale peer inactivity metrics by recalculating the inactivity cutoff on every metrics update tick rather than only during application startup.
Changes:
- Passes
max_peer_timeoutinto the registry metrics job instead of a startup-computed cutoff. - Recomputes the cutoff immediately before each activity metrics update.
- Adds a stopped-clock regression test covering peers becoming inactive after the job starts.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/bootstrap/jobs/activity_metrics_updater.rs |
Passes the configured timeout into the registry job and removes startup cutoff calculation. |
packages/swarm-coordination-registry/src/statistics/activity_metrics_updater.rs |
Recomputes the cutoff per tick and adds regression coverage. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Summary
The activity metrics updater now recomputes the peer inactivity cutoff before every update tick instead of reusing the startup timestamp.
Changes
Updated the swarm coordination registry metrics job and application bootstrap wiring. Added a stopped-clock regression test that advances time after the job starts and verifies inactive peers are reported on the next update.
Validation
The focused registry test and all 105 registry library tests pass. The mandatory pre-push checks also pass: nightly formatting, workspace checks, documentation build, and the full test suite.
Closes #2226