Skip to content

Conversation

@josecelano
Copy link
Member

Events listeners listen for the cancellation request instead of directly for the CRTR+c signal. This will allow implementing centralized policies for shutdown and alternative conditions.

In the future, we should implement the same for all tasks, including:

  • HTTP servers using axum: torrust_server_lib::signals::global_shutdown_signal
  • Job to update metrics: torrust_tracker_swarm_coordination_registry::statistics::activity_metrics_updater::start_job
  • Torrent cleanup jonb: torrust_tracker_lib::bootstrap::jobs::torrent_cleanup::start_job

Events listeners listen for the cancelation request instead of directly
for the CRTR+c signal. This will allow implementing centralized
policies for shutdown and alternative conditions.
@josecelano
Copy link
Member Author

ACK d2e75e3

@codecov
Copy link

codecov bot commented Jun 17, 2025

Codecov Report

Attention: Patch coverage is 80.29197% with 27 lines in your changes missing coverage. Please review.

Project coverage is 84.60%. Comparing base (1ad19e7) to head (d2e75e3).
Report is 2 commits behind head on develop.

Files with missing lines Patch % Lines
...dination-registry/src/statistics/event/listener.rs 61.53% 4 Missing and 1 partial ⚠️
...ages/tracker-core/src/statistics/event/listener.rs 44.44% 4 Missing and 1 partial ⚠️
...http-tracker-core/src/statistics/event/listener.rs 72.72% 2 Missing and 1 partial ⚠️
.../udp-tracker-core/src/statistics/event/listener.rs 72.72% 3 Missing ⚠️
...s/udp-tracker-server/src/banning/event/listener.rs 75.00% 3 Missing ⚠️
...dp-tracker-server/src/statistics/event/listener.rs 72.72% 3 Missing ⚠️
src/bootstrap/jobs/manager.rs 70.00% 3 Missing ⚠️
src/main.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1587      +/-   ##
===========================================
+ Coverage    84.59%   84.60%   +0.01%     
===========================================
  Files          287      287              
  Lines        21382    21447      +65     
  Branches     21382    21447      +65     
===========================================
+ Hits         18088    18146      +58     
- Misses        2979     2985       +6     
- Partials       315      316       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@josecelano josecelano self-assigned this Jun 17, 2025
@josecelano josecelano added the Code Cleanup / Refactoring Tidying and Making Neat label Jun 17, 2025
@josecelano
Copy link
Member Author

I've opened a new issue to do the same for other jobs not related to events.

@josecelano josecelano merged commit b254ffd into torrust:develop Jun 17, 2025
20 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Code Cleanup / Refactoring Tidying and Making Neat

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Overhaul stats: Implement a graceful shutdown for broadcast channels

1 participant