This is an automated email from the ASF dual-hosted git repository.

fanrui pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git

commit cf0ac00cfe84c34af64308cebfc4a9034b94fddc
Author: Rui Fan <[email protected]>
AuthorDate: Mon Dec 25 15:35:11 2023 +0800

    [FLINK-33935][checkpoint] Improve the default value logic related to 
`execution.checkpointing.tolerable-failed-checkpoints`
---
 .../shortcodes/generated/execution_checkpointing_configuration.html   | 2 +-
 .../org/apache/flink/streaming/api/environment/CheckpointConfig.java  | 4 +---
 .../streaming/api/environment/ExecutionCheckpointingOptions.java      | 2 +-
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git 
a/docs/layouts/shortcodes/generated/execution_checkpointing_configuration.html 
b/docs/layouts/shortcodes/generated/execution_checkpointing_configuration.html
index 14ff75f5b4f..60b45004393 100644
--- 
a/docs/layouts/shortcodes/generated/execution_checkpointing_configuration.html
+++ 
b/docs/layouts/shortcodes/generated/execution_checkpointing_configuration.html
@@ -70,7 +70,7 @@
         </tr>
         <tr>
             
<td><h5>execution.checkpointing.tolerable-failed-checkpoints</h5></td>
-            <td style="word-wrap: break-word;">(none)</td>
+            <td style="word-wrap: break-word;">0</td>
             <td>Integer</td>
             <td>The tolerable checkpoint consecutive failure number. If set to 
0, that means we do not tolerance any checkpoint failure. This only applies to 
the following failure reasons: IOException on the Job Manager, failures in the 
async phase on the Task Managers and checkpoint expiration due to a timeout. 
Failures originating from the sync phase on the Task Managers are always 
forcing failover of an affected task. Other types of checkpoint failures (such 
as checkpoint being subsum [...]
         </tr>
diff --git 
a/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/CheckpointConfig.java
 
b/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/CheckpointConfig.java
index cf299080571..88073f90af4 100644
--- 
a/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/CheckpointConfig.java
+++ 
b/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/CheckpointConfig.java
@@ -478,9 +478,7 @@ public class CheckpointConfig implements 
java.io.Serializable {
      * tolerate any declined checkpoint failure.
      */
     public int getTolerableCheckpointFailureNumber() {
-        return configuration
-                
.getOptional(ExecutionCheckpointingOptions.TOLERABLE_FAILURE_NUMBER)
-                .orElse(0);
+        return 
configuration.get(ExecutionCheckpointingOptions.TOLERABLE_FAILURE_NUMBER);
     }
 
     /**
diff --git 
a/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/ExecutionCheckpointingOptions.java
 
b/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/ExecutionCheckpointingOptions.java
index ad2b4a10890..14e9ae52c95 100644
--- 
a/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/ExecutionCheckpointingOptions.java
+++ 
b/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/ExecutionCheckpointingOptions.java
@@ -85,7 +85,7 @@ public class ExecutionCheckpointingOptions {
     public static final ConfigOption<Integer> TOLERABLE_FAILURE_NUMBER =
             
ConfigOptions.key("execution.checkpointing.tolerable-failed-checkpoints")
                     .intType()
-                    .noDefaultValue()
+                    .defaultValue(0)
                     .withDescription(
                             "The tolerable checkpoint consecutive failure 
number. If set to 0, that means "
                                     + "we do not tolerance any checkpoint 
failure. This only applies to the following failure reasons: IOException on the 
"

Reply via email to