split shutdown deadline into cooperative and abort phases#2
Merged
Conversation
There was a problem hiding this comment.
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 updatesrun_to_completionto accept it. - Updates existing integration tests to use the new shutdown options API and adds new tests for defaults, panic payload recording, and
Displaywriter 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.
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.