Repository navigation
Conversation
eamsden
marked this pull request as draft
October 9, 2026 02:00
This branch has not been deployed
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.
Worker examples currently use
Worker::run(), so SIGINT and SIGTERM terminate the process without initiating worker shutdown. Add opt-inWorker::run_until_signal()and use it in the worker examples and getting-started documentation. On Unix, both signals initiate the existing shutdown path and await the worker result, allowing activity completion and cleanup to follow the configured grace period. Windows uses Ctrl-C.Applications retain control of their signal policy through
run()andshutdown_handle(). The helper owns and drops its signal receivers without spawning a signal task; the API docs explain Tokio's persistent process-wide signal handlers and existing future cancellation semantics. Registration failures use a typed worker error. Includes a Rust SDK changelog entry.Related to #1637: this follows the existing
run()lifecycle; the application-owned shutdown future and consuming Core finalization remain in that separate PR.Validation on macOS with the repository's Rust 1.94 toolchain:
cargo +nightly fmtcargo lintcargo test-lintcargo test --features experimental— workspace tests and doctests passed. Tests requiring local sockets/native certificates were run outside the sandbox.timeout 180 cargo integ-test -s external -- worker_signal --nocapture— 6 passed. Subprocesses receive real SIGINT/SIGTERM and verify activity draining, cancellation after grace expiry, cleanup, completion reporting, shutdown hooks, and drained polling queues. Also verifies explicit shutdown and validation failure without a signal. No Temporal server is required for these tests.RUSTDOCFLAGS="-D warnings" cargo doc --workspace --all-features --no-depsWindows runtime behavior and the full server-backed integration suite were not tested locally; the existing CI matrix covers Windows and both Unix platforms.