Skip to content

Commit 1b1c1d4

Browse files
authored
Make DeterministicRunner#close always block until the closing is done (#1255)
1 parent 0831d12 commit 1b1c1d4

File tree

9 files changed

+224
-128
lines changed

9 files changed

+224
-128
lines changed

temporal-sdk/src/main/java/io/temporal/internal/replay/WorkflowExecutorCache.java

+2
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,11 @@
3737
import java.util.concurrent.ExecutionException;
3838
import java.util.concurrent.locks.Lock;
3939
import java.util.concurrent.locks.ReentrantLock;
40+
import javax.annotation.concurrent.ThreadSafe;
4041
import org.slf4j.Logger;
4142
import org.slf4j.LoggerFactory;
4243

44+
@ThreadSafe
4345
public final class WorkflowExecutorCache {
4446
private final Logger log = LoggerFactory.getLogger(WorkflowExecutorCache.class);
4547

temporal-sdk/src/main/java/io/temporal/internal/sync/DeterministicRunner.java

+1-9
Original file line numberDiff line numberDiff line change
@@ -79,21 +79,13 @@ static DeterministicRunner newRunner(
7979
/** IsDone returns true when all of threads are completed */
8080
boolean isDone();
8181

82-
/**
83-
* @return exit value passed to {@link WorkflowThread#exit(Object)}
84-
*/
85-
Object getExitValue();
86-
8782
/**
8883
* Request cancellation of the computation. Calls {@link CancellationScope#cancel(String)} on the
8984
* root scope that wraps the root Runnable.
9085
*/
9186
void cancel(String reason);
9287

93-
/**
94-
* Destroys all threads by throwing {@link DestroyWorkflowThreadError} without waiting for their
95-
* completion
96-
*/
88+
/** Destroys all controlled workflow threads, blocks until the threads are destroyed */
9789
void close();
9890

9991
/** Stack trace of all threads owned by the DeterministicRunner instance */

0 commit comments

Comments
 (0)