Skip to content

Commit 18e5901

Browse files
committed
log unexpected shutdown
Signed-off-by: Cassandra Coyle <[email protected]>
1 parent c2e5245 commit 18e5901

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

client/src/main/java/com/microsoft/durabletask/DurableTaskGrpcWorker.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public final class DurableTaskGrpcWorker implements AutoCloseable {
3737
private final ExecutorService workerPool;
3838

3939
private final TaskHubSidecarServiceBlockingStub sidecarClient;
40+
private volatile boolean isNormalShutdown = false;
4041

4142
DurableTaskGrpcWorker(DurableTaskGrpcWorkerBuilder builder) {
4243
this.orchestrationFactories.putAll(builder.orchestrationFactories);
@@ -218,6 +219,7 @@ public void startAndBlock() {
218219
* Stops the current worker's listen loop, preventing any new orchestrator or activity events from being processed.
219220
*/
220221
public void stop() {
222+
this.isNormalShutdown = true;
221223
this.close();
222224
}
223225

@@ -234,7 +236,9 @@ private void closeSideCarChannel() {
234236
}
235237

236238
private void shutDownWorkerPool() {
237-
logger.log(Level.WARNING, "ExecutorService shutdown initiated. No new tasks will be accepted");
239+
if (!this.isNormalShutdown) {
240+
logger.log(Level.WARNING, "ExecutorService shutdown initiated unexpectedly. No new tasks will be accepted");
241+
}
238242

239243
this.workerPool.shutdown();
240244
try {

0 commit comments

Comments
 (0)