Skip to content

Commit 70eae92

Browse files
committed
fix: stop thread pools when an error occurs during startup
Signed-off-by: Gerard de Leeuw <[email protected]>
1 parent a29c009 commit 70eae92

File tree

1 file changed

+5
-0
lines changed
  • operator-framework-core/src/main/java/io/javaoperatorsdk/operator

1 file changed

+5
-0
lines changed

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/Operator.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,12 @@ public synchronized void start() {
203203
public void stop() throws OperatorException {
204204
Duration reconciliationTerminationTimeout =
205205
configurationService.reconciliationTerminationTimeout();
206+
206207
if (!started) {
208+
// Always stop the executor service manager to prevent dangling threads,
209+
// even if the operator didn't fully start
210+
configurationService.getExecutorServiceManager().stop(reconciliationTerminationTimeout);
211+
207212
return;
208213
}
209214
log.info(

0 commit comments

Comments
 (0)