From 2c6a35797dd23922c6e959850855ab69685f76f6 Mon Sep 17 00:00:00 2001 From: csviri Date: Mon, 30 Jan 2023 10:47:48 +0100 Subject: [PATCH 1/2] docs: describe informer stop handler code --- .../operator/api/config/ConfigurationService.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationService.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationService.java index 8692679708..b3af7adb8c 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationService.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationService.java @@ -193,6 +193,9 @@ default Optional getInformerStoppedHandler() { log.error("Fatal error in informer: {}. Stopping the operator", informer, ex); System.exit(1); } else { + // In case informer is stopped on start (not synced) the controller will stop automatically. + // The case when already synced and stopped without an exception, can happen only if + // informer is stopped explicitly. log.debug("Informer stopped: {}. Error: {}", informer, ex); } }); From 57d5fb4fcef400eff04f97c34b79cc1ed3305615 Mon Sep 17 00:00:00 2001 From: csviri Date: Mon, 6 Feb 2023 09:45:31 +0100 Subject: [PATCH 2/2] improved log message --- .../operator/api/config/ConfigurationService.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationService.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationService.java index b3af7adb8c..e9249505ab 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationService.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationService.java @@ -193,10 +193,11 @@ default Optional getInformerStoppedHandler() { log.error("Fatal error in informer: {}. Stopping the operator", informer, ex); System.exit(1); } else { - // In case informer is stopped on start (not synced) the controller will stop automatically. - // The case when already synced and stopped without an exception, can happen only if - // informer is stopped explicitly. - log.debug("Informer stopped: {}. Error: {}", informer, ex); + log.debug( + "Informer stopped: {}. Has synced: {}, Error: {}. This can happen as a result of " + + "stopping the controller, or due to an error on startup." + + "See also stopOnInformerErrorDuringStartup configuration.", + informer, informer.hasSynced(), ex); } }); }