Repository navigation
feat(shutdown): [#2221] migrate activity metrics updater to cancellation token - #2224
josecelano merged 4 commits into
Conversation
Move the SI-5 shutdown draft to docs/issues/open/ as the specification for GitHub issue torrust#2221 (migrate the activity metrics updater to CancellationToken) and mark it as sequence 4 in the EPIC torrust#1488 roadmap. Related to torrust#2221 Related to torrust#1488
Replace the updater's direct Ctrl-C listener and pre-spawned handle with a token-aware runner directly supervised by JobManager. Add deterministic lifecycle and manager-outcome tests, document the remaining UDP compatibility handle, and record verification evidence. Closes torrust#2221
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2224 +/- ##
===========================================
+ Coverage 85.45% 85.48% +0.03%
===========================================
Files 353 353
Lines 31240 31315 +75
Branches 31240 31315 +75
===========================================
+ Hits 26695 26771 +76
- Misses 4171 4173 +2
+ Partials 374 371 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 Changes recommended
One or more issues must be addressed before approval.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Migrates the activity metrics updater to direct JobManager supervision with CancellationToken cancellation.
Changes:
- Replaces the legacy Ctrl-C listener with a cancellable runner and lifecycle tests.
- Removes Tokio’s production
signalfeature. - Updates shutdown documentation, issue specifications, and verification evidence.
File summaries
| File | Description |
|---|---|
| src/bootstrap/jobs/activity_metrics_updater.rs | Updated as part of this pull request. |
| src/app.rs | Updated as part of this pull request. |
| src/AGENTS.md | Updated as part of this pull request. |
| packages/swarm-coordination-registry/src/statistics/activity_metrics_updater.rs | Updated as part of this pull request. |
| packages/swarm-coordination-registry/Cargo.toml | Updated as part of this pull request. |
| docs/issues/open/2221-1488-si-5-migrate-activity-metrics-updater/manual-verification-evidence.md | Updated as part of this pull request. |
| docs/issues/open/2221-1488-si-5-migrate-activity-metrics-updater/ISSUE.md | Updated as part of this pull request. |
| docs/issues/open/2221-1488-si-5-migrate-activity-metrics-updater/agent-review-reports.md | Updated as part of this pull request. |
| docs/issues/open/1488-overhaul-tracker-shutdown/ISSUE.md | Updated as part of this pull request. |
| docs/issues/drafts/1488-si-5-migrate-activity-metrics-updater/verification.md | Updated as part of this pull request. |
| docs/issues/drafts/1488-si-5-migrate-activity-metrics-updater/ISSUE.md | Updated as part of this pull request. |
Review details
Suppressed comments (4)
docs/issues/open/2221-1488-si-5-migrate-activity-metrics-updater/ISSUE.md:11
last-updated-utcis 09:30, but this same specification records changes through 10:04 UTC at lines 216–219. The metadata is stale; update it to the timestamp of the latest content change before merging.
last-updated-utc: 2026-09-15 09:30
docs/issues/open/2221-1488-si-5-migrate-activity-metrics-updater/ISSUE.md:10
- This issue is being delivered by PR #2224, but the new specification leaves
related-prnull. Existing folder-style issue specs record the implementation PR in this field; set it to2224so the issue-to-PR relationship remains queryable.
related-pr: null
docs/issues/open/2221-1488-si-5-migrate-activity-metrics-updater/ISSUE.md:197
- This progress entry retains a literal reference to the draft spec that this PR deletes. The resulting path is stale and breaks navigation; point the entry at the new open spec (or describe the move without a dead path).
- [x] Folder-style spec drafted in `docs/issues/drafts/1488-si-5-migrate-activity-metrics-updater/ISSUE.md`
packages/swarm-coordination-registry/Cargo.toml:27
- Removing
signalfrom the explicit list does not remove it from this package's production Tokio feature set becausedefault-featuresremains enabled and Tokio's default features includesignal. The advertised feature trim is therefore ineffective; disable default features and explicitly retain the features this package uses, includingtimefortokio::time.
tokio = { version = "1", features = [ "macros", "net", "rt-multi-thread", "sync" ] }
- Files reviewed: 11/11 changed files
- Comments generated: 6
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Add separate registry and statistics repository expiry tests and align issue metadata and review evidence with the documented conventions. Related to torrust#2221
|
ACK 8a1c0b3 |
…ssues/closed ca2cd4e docs(review): document PR #2227 copilot suggestions audit (Jose Celano) f8bc7db docs(review): address PR #2227 timestamp feedback (Jose Celano) 7a4301a chore(issues): archive closed issue #2221 spec to docs/issues/closed (Jose Celano) Pull request description: ## Summary - Archive the completed #2221 SI-5 specification, review records, and manual verification evidence under `docs/issues/closed/`. - Update EPIC #1488 to mark SI-5 complete and link the archived specification. - Align current job-ownership and shutdown task-inventory documentation with direct `JoinSet` supervision for `peers_inactivity_update`; `udp_ban_cleanup` is now the sole legacy periodic job. ## Validation - Verified GitHub issue #2221 is `CLOSED` and implementation PR #2224 is merged. - Reviewed and repaired live references to the archived spec; retained only immutable historical PR-review references. - Independent task review passed. - `linter all`, pre-commit checks, pre-push checks, nightly workspace format/check/docs, and the full test suite passed. Related to #2221 Related to #1488 ACKs for top commit: josecelano: ACK ca2cd4e Tree-SHA512: 7d9e94a8373b6b0207ad0a3bdb3e5136a199ac01f4c82207c7fe250291d4cfa8027f0c95eb440405998c43a4a4c264b578143a1b4e0515623d03d1881e2a147a
Summary
CancellationTokenrunner directly supervised byJobManager.signalfeature fromswarm-coordination-registry, retain Tokiotest-utilonly for paused-time tests, and documentudp_ban_cleanupas the remaining legacy periodic handle.Files and packages
packages/swarm-coordination-registrysrc/bootstrap/jobs/activity_metrics_updater.rssrc/app.rssrc/AGENTS.mddocs/issues/open/2221-1488-si-5-migrate-activity-metrics-updater/Validation
peers_inactivity_updatereportsJobStatus::CancelledthroughJobManager.linter all, workspace documentation tests, pre-commit checks, and pre-push checks passed.Closes #2221
Parent EPIC: #1488