diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ControllerConfiguration.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ControllerConfiguration.java index 2c18fa55d3..3898493c82 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ControllerConfiguration.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ControllerConfiguration.java @@ -57,7 +57,7 @@ default boolean isGenerationAware() { String getAssociatedReconcilerClassName(); default Retry getRetry() { - return GenericRetry.DEFAULT; + return GenericRetry.defaultLimitedExponentialRetry(); } @SuppressWarnings("rawtypes") diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/retry/GenericRetry.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/retry/GenericRetry.java index 9b42971e7c..0ff44a6fe7 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/retry/GenericRetry.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/retry/GenericRetry.java @@ -10,10 +10,15 @@ public class GenericRetry implements Retry, AnnotationConfigurable private double intervalMultiplier = GradualRetry.DEFAULT_MULTIPLIER; private long maxInterval = GradualRetry.DEFAULT_MAX_INTERVAL; + /** + * @deprecated use {@link GenericRetry#defaultLimitedExponentialRetry()} instead this instance. + * Since GenericRetry is mutable, singleton is problematic. + */ + @Deprecated(forRemoval = true) public static final Retry DEFAULT = new GenericRetry(); public static GenericRetry defaultLimitedExponentialRetry() { - return (GenericRetry) DEFAULT; + return new GenericRetry(); } public static GenericRetry noRetry() {