Skip to content

Commit bf26c88

Browse files
csvirimetacosm
authored andcommitted
fix
1 parent 93ad705 commit bf26c88

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationServiceOverrider.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ public ExecutorService getExecutorService() {
130130

131131
@Override
132132
public ExecutorService getWorkflowExecutorService() {
133-
return workflowExecutorService != null ? workflowExecutorService : original.getWorkflowExecutorService();
133+
return workflowExecutorService != null ? workflowExecutorService
134+
: original.getWorkflowExecutorService();
134135
}
135136

136137
@Override

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ExecutorServiceManager.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,16 @@ private void doStop() {
7676
try {
7777
log.debug("Closing executor");
7878
executor.shutdown();
79-
workflowExecutor.shutdown();
80-
if (!executor.awaitTermination(terminationTimeoutSeconds, TimeUnit.SECONDS)) {
81-
executor.shutdownNow(); // if we timed out, waiting, cancel everything
79+
if (workflowExecutor != null) {
80+
workflowExecutor.shutdown();
81+
if (!workflowExecutor.awaitTermination(terminationTimeoutSeconds, TimeUnit.SECONDS)) {
82+
workflowExecutor.shutdownNow(); // if we timed out, waiting, cancel everything
83+
}
8284
}
83-
if (!workflowExecutor.awaitTermination(terminationTimeoutSeconds, TimeUnit.SECONDS)) {
85+
if (!executor.awaitTermination(terminationTimeoutSeconds, TimeUnit.SECONDS)) {
8486
executor.shutdownNow(); // if we timed out, waiting, cancel everything
8587
}
88+
8689
} catch (InterruptedException e) {
8790
log.debug("Exception closing executor: {}", e.getLocalizedMessage());
8891
}

0 commit comments

Comments
 (0)