Skip to content

split shutdown deadline into cooperative and abort phases#2

Merged
mcharytoniuk merged 2 commits into
mainfrom
service-shutdown-options
May 22, 2026
Merged

split shutdown deadline into cooperative and abort phases#2
mcharytoniuk merged 2 commits into
mainfrom
service-shutdown-options

Conversation

@mcharytoniuk
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates trzcina’s shutdown API to split the previous single shutdown deadline into two phases (cooperative and abort), and adjusts documentation and tests accordingly.

Changes:

  • Introduces ServiceShutdownOptions { cooperative_deadline, abort_deadline } and updates run_to_completion to accept it.
  • Updates existing integration tests to use the new shutdown options API and adds new tests for defaults, panic payload recording, and Display writer error propagation.
  • Updates README usage and raises the coverage gate in the Makefile.

Reviewed changes

Copilot reviewed 32 out of 32 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
trzcina/src/service_shutdown_options.rs Adds the new per-phase shutdown options type with defaults.
trzcina/src/running_service_collection.rs Changes run_to_completion to apply cooperative vs abort deadlines independently.
trzcina/src/lib.rs Wires the new module and re-exports ServiceShutdownOptions.
trzcina/src/service_shutdown_error.rs Refactors Display implementation to propagate writer errors reliably.
trzcina/tests/supports_notify_driven_event_loop_pattern.rs Updates test to call run_to_completion(ServiceShutdownOptions::default()).
trzcina/tests/supports_mutable_internal_state_across_iterations.rs Updates test to use new shutdown options API.
trzcina/tests/supports_multi_channel_select_pump_pattern.rs Updates test to use new shutdown options API.
trzcina/tests/supports_interval_ticker_reconciliation_pattern.rs Updates test to use new shutdown options API.
trzcina/tests/supports_internal_retry_loop_pattern.rs Updates test to use new shutdown options API.
trzcina/tests/supports_actix_style_shutdown_signal_pattern.rs Updates test to use new shutdown options API.
trzcina/tests/run_reports_leaked_beyond_abort_deadline_when_service_ignores_abort.rs Uses explicit cooperative/abort deadlines for leak detection.
trzcina/tests/run_records_string_literal_panic_payload.rs Updates test to use new shutdown options API.
trzcina/tests/run_records_non_string_panic_payload.rs Updates test to use new shutdown options API.
trzcina/tests/run_records_service_panic_and_cancels_siblings.rs Updates test to use new shutdown options API.
trzcina/tests/run_records_service_error_and_cancels_siblings.rs Updates test to use new shutdown options API.
trzcina/tests/run_records_all_failures_when_multiple_services_error.rs Updates test to use new shutdown options API.
trzcina/tests/run_completes_when_all_services_finish_simultaneously.rs Updates test to use new shutdown options API.
trzcina/tests/run_completes_immediately_when_no_services_registered.rs Updates test to use new shutdown options API.
trzcina/tests/run_cancels_siblings_when_one_service_finishes_first.rs Updates test to use new shutdown options API.
trzcina/tests/run_cancels_all_services_when_external_token_cancelled.rs Updates test to use new shutdown options API.
trzcina/tests/run_aborts_hung_services_on_external_cancel.rs Uses explicit cooperative/abort deadlines for abort behavior.
trzcina/tests/run_aborts_hung_service_after_shutdown_deadline.rs Uses explicit cooperative/abort deadlines for abort behavior.
trzcina/tests/register_service_runs_registered_service.rs Updates test to use new shutdown options API.
trzcina/tests/register_bundle_runs_all_services_returned_by_bundle.rs Updates test to use new shutdown options API.
trzcina/tests/coordinates_via_shared_holder_between_two_services.rs Updates test to use new shutdown options API.
trzcina/tests/service_shutdown_options_default_uses_ten_second_deadlines.rs Adds a unit test asserting the default deadlines are 10 seconds each.
trzcina/tests/service_shutdown_error_display_propagates_header_writer_error.rs Adds test ensuring Display propagates header write errors.
trzcina/tests/service_shutdown_error_display_propagates_outcome_writer_error.rs Adds test ensuring Display propagates outcome line write errors.
trzcina/tests/run_records_string_panic_payload.rs Adds test ensuring panics with owned String payload are recorded.
trzcina/tests/run_applies_cooperative_and_abort_deadlines_independently.rs Adds test validating the two deadlines behave independently.
README.md Updates usage example and documents the two shutdown phases.
Makefile Raises coverage gate to 100%.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread trzcina/src/service_shutdown_error.rs
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 32 out of 32 changed files in this pull request and generated 3 comments.

Comment thread trzcina/src/service_shutdown_error.rs
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 35 out of 35 changed files in this pull request and generated 5 comments.

Comments suppressed due to low confidence (1)

trzcina/tests/run_reports_leaked_beyond_shutdown_deadline_when_service_ignores_abort.rs:55

  • This assertion uses ServiceShutdownOutcome::LeakedBeyondShutdownDeadline, but the test name and configured option (abort_deadline: Duration::from_millis(50)) indicate this is specifically the abort-phase deadline. Consider renaming the outcome variant (or at least aligning the test name/outcome naming) so it's clear which phase timed out.

Comment thread trzcina/src/service_shutdown_outcome.rs
Comment thread trzcina/src/service_shutdown_error.rs
Comment thread trzcina/src/running_service_collection.rs
@mcharytoniuk mcharytoniuk merged commit 71f8894 into main May 22, 2026
6 checks passed
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