From 74c0956b77cd5ec500ef0206ca7c7739955b834b Mon Sep 17 00:00:00 2001 From: csviri Date: Mon, 31 Oct 2022 10:32:27 +0100 Subject: [PATCH] docs: sync timeout docs improvement --- docs/documentation/patterns-best-practices.md | 6 ++++-- .../operator/api/config/ConfigurationService.java | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/documentation/patterns-best-practices.md b/docs/documentation/patterns-best-practices.md index f8fdf64c21..6a5f729fcd 100644 --- a/docs/documentation/patterns-best-practices.md +++ b/docs/documentation/patterns-best-practices.md @@ -105,7 +105,7 @@ advised to put such state into a separate resource meant for this purpose such a Kubernetes Secret or ConfigMap or even a dedicated Custom Resource, which structure can be more easily validated. -## Stopping (or not) Operator in case of Informer Errors +## Stopping (or not) Operator in case of Informer Errors and Cache Sync Timeouts It can be [configured](https://github.com/java-operator-sdk/java-operator-sdk/blob/2cb616c4c4fd0094ee6e3a0ef2a0ea82173372bf/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationService.java#L168-L168) @@ -120,4 +120,6 @@ that is when a resource cannot be deserialized. The typical use case for changin is watched by a controller. In is better to start up the operator, so it can handle other namespaces while there might be a permission issue for some resources in another namespace. - +The `stopOnInformerErrorDuringStartup` has implication on [cache sync timeout](https://github.com/java-operator-sdk/java-operator-sdk/blob/114c4312c32b34688811df8dd7cea275878c9e73/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationService.java#L177-L179) +behavior. If true operator will stop on cache sync timeout. if `false`, after the timeout the controller will start +reconcile resources even if one or more event source caches did not sync yet. 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 9f4bde5beb..1fe9485588 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 @@ -170,7 +170,7 @@ default boolean stopOnInformerErrorDuringStartup() { } /** - * Timeout for cache sync in milliseconds. In other words source start timeout. Note that is + * Timeout for cache sync. In other words source start timeout. Note that is * "stopOnInformerErrorDuringStartup" is true the operator will stop on timeout. Default is 2 * minutes. */