-
Notifications
You must be signed in to change notification settings - Fork 192
Closed
Description
Expected Behavior
io.temporal.internal.client.external.GenericWorkflowClient should allow all resources to be reclaimed and not block natural termination of the JVM.
The Reproduction steps should finish with the java process exiting.
Actual Behavior
Once the asyncThrottlerExecutor in that class has started a thread, there is no mechanism to terminate it, and the JVM will not exit unless System.exit() is manually called.
The java call does not exit.
Steps to Reproduce the Problem
- Checkout the https://github.com/temporalio/money-transfer-project-java repo from the Getting Started tutorial .
- Add this commit on top: lverns/money-transfer-project-java@2492e11
- Generate a classpath:
mvn dependency:build-classpath -Dmdep.outputFile=cp.txt - Compile
mvn compile - Run the worker:
mvn exec:java -Dexec.mainClass="moneytransferapp.MoneyTransferWorker" -Dorg.slf4j.simpleLogger.defaultLogLevel=warn - In another terminal run the app:
java -cp $(cat cp.txt):target/classes moneytransferapp.TransferApp - Observe that the app prints "Got Transfer complete", but the JVM remains running.
- If you inspect the process with
jstackyou will see a non-daemon thread calledgeneric-wf-client-async-throttlerthat is preventing the JVM from exiting.
Specifications
- Version: 1.24.1
- Platform: Linux
- Java Version: OpenJDK Runtime Environment (Red_Hat-21.0.6.0.7-1) (build 21.0.6+7)
Other notes
This seems to be a known issue based on a comment in the code, but opening this bug for visibility.
An easy work around is to call System.exit(0), but it seems possible that there are scenarios where a program might want to rely on the JVM's exit semantics.
Metadata
Metadata
Assignees
Labels
No labels