Repository navigation
Conversation
eamsden
marked this pull request as draft
October 9, 2026 01:58
Contributor
|
There is already a PR open addressing this #3115 I believe |
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.
What changed?
Manage auto-configured root and non-root worker factories with Spring's
SmartLifecycle. Context shutdown initiatesWorkerFactory.shutdown()and waits for termination before bean destruction, bounded byspring.lifecycle.timeout-per-shutdown-phase. Retain shutdown cleanup when context initialization fails.Remove the non-root context-close listener that ignored its own context and instead stopped workers when a child context closed. Keep existing worker startup settings and application control of JVM shutdown hooks.
Document shutdown ownership for standalone factories and Spring Boot applications, and add a changelog entry.
Why?
The JVM already delivers SIGINT and SIGTERM to the same shutdown hooks. Spring's root factory destroy method initiated shutdown without waiting, and non-root factories were not shut down when their own context closed. Both signals could therefore end the process before in-flight activities finished.
Breaking changes?
No existing public API signatures changed. Spring context shutdown now waits for graceful worker termination within its configured lifecycle timeout. The integration continues using orderly shutdown and preserves activity cancellation semantics.
Server PR
None required.
Validation
Run on macOS with the repository's Java 21 toolchain; changed Java sources compile with
--release 8../gradlew --offline spotlessApply :temporal-spring-boot-autoconfigure:test :temporal-sdk:javadoc :temporal-spring-boot-autoconfigure:javadoc: passed; Spring suite had 49 passed and 2 conditional skips. Both Javadoc tasks passed../gradlew --offline :temporal-sdk:test --tests 'io.temporal.worker.WorkerShutdownTest' --tests 'io.temporal.worker.shutdown.*' --tests 'io.temporal.workerFactory.WorkerFactoryTests': 17 passed, 3 external-server tests skipped.The complete multi-module test suite and Linux/Windows runtime execution were not run locally. The Spring suite's conditional skips cover worker versioning (external server required) and OpenTelemetry auto-configuration (Spring Boot 3+ required).