Skip to content

Commit 208c8a6

Browse files
committed
Event handler waits a long time before terminating operator-framework#436
1 parent 255c69f commit 208c8a6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/DefaultEventHandler.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,8 @@ public class DefaultEventHandler implements EventHandler {
4343
private final Map<String, RetryExecution> retryState = new HashMap<>();
4444
private final String controllerName;
4545
private final int terminationTimeout;
46-
private DefaultEventSourceManager eventSourceManager;
47-
4846
private final ReentrantLock lock = new ReentrantLock();
47+
private DefaultEventSourceManager eventSourceManager;
4948

5049
public DefaultEventHandler(
5150
ResourceController controller, ControllerConfiguration configuration, MixedOperation client) {
@@ -91,6 +90,7 @@ private DefaultEventHandler(
9190
public void close() {
9291
try {
9392
log.debug("Closing handler for {}", controllerName);
93+
executor.shutdown();
9494
executor.awaitTermination(terminationTimeout, TimeUnit.SECONDS);
9595
} catch (InterruptedException e) {
9696
log.debug("Exception closing handler for {}: {}", controllerName, e.getLocalizedMessage());
@@ -233,7 +233,8 @@ private RetryExecution getOrInitRetryExecution(ExecutionScope executionScope) {
233233
* <p>Note that this is an improvement, not a bug fix. This situation can happen naturally, we
234234
* just make the execution more efficient, and avoid questions about conflicts.
235235
*
236-
* <p>Note that without the conditional locking in the cache, there is a very minor chance that we
236+
* <p>Note that without the conditional locking in the cache, there is a very minor chance that
237+
* we
237238
* would override an additional change coming from a different client.
238239
*/
239240
private void cacheUpdatedResourceIfChanged(

0 commit comments

Comments
 (0)