Skip to content

feat(signals): add token-aware shutdown wait - #1

Merged
josecelano merged 1 commit into
mainfrom
2234-token-aware-shutdown-wait
Sep 16, 2026
Merged

josecelano merged 1 commit into
mainfrom
2234-token-aware-shutdown-wait

Conversation

@josecelano

Copy link
Copy Markdown
Member

Summary

  • Add signals::cancellation_signal(CancellationToken), an additive shutdown waiter that never subscribes to an OS signal.
  • Preserve the existing global_shutdown_signal(), shutdown_signal(), shutdown_signal_with_message(), and Halted APIs.
  • Add deterministic coverage for injected-token cancellation and legacy Halted::Normal behavior.
  • Bump torrust-server-lib from 0.2.0 to 0.3.0 for the additive public API.

Validation

  • cargo fmt --check
  • cargo clippy -- -D warnings
  • cargo test
  • cargo publish --dry-run

Related to torrust/torrust-tracker#2234.

Copilot AI lite review requested due to automatic review settings September 16, 2026 08:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved review comments; changes are additive and preserve existing APIs.

Pull request overview

Adds a token-aware shutdown waiter while preserving existing signal APIs.

Changes:

  • Adds cancellation_signal(CancellationToken) and tests.
  • Adds tokio-util and updates the lockfile.
  • Bumps torrust-server-lib to 0.3.0.
File summaries
File Description
src/signals.rs Adds token cancellation and compatibility tests.
Cargo.toml Updates dependency and package version.
Cargo.lock Records dependency graph changes.
Review details
  • Files reviewed: 2/3 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@josecelano josecelano self-assigned this Sep 16, 2026
@josecelano

Copy link
Copy Markdown
Member Author

ACK ea333ec

@josecelano
josecelano merged commit 2b3f8ec into main Sep 16, 2026
2 checks passed
@josecelano
josecelano deleted the 2234-token-aware-shutdown-wait branch September 16, 2026 08:24
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.

2 participants