diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/internal/CustomResourceEventSource.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/internal/CustomResourceEventSource.java index 55ed716c45..f93d68684b 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/internal/CustomResourceEventSource.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/internal/CustomResourceEventSource.java @@ -154,7 +154,12 @@ public void onClose(WatcherException e) { } if (e.isHttpGone()) { log.warn("Received error for watch, will try to reconnect.", e); - registerWatch(); + try { + registerWatch(); + } catch (Throwable ex) { + log.error("Unexpected error happened with watch reconnect. Will exit.", e); + System.exit(1); + } } else { // Note that this should not happen normally, since fabric8 client handles reconnect. // In case it tries to reconnect this method is not called.