You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/06/13 12:12:27 UTC

[GitHub] [flink] zhuzhurk commented on a change in pull request #8698: [FLINK-12669][runtime] Implement FixedDelayRestartBackoffTimeStrategy

zhuzhurk commented on a change in pull request #8698: [FLINK-12669][runtime] Implement FixedDelayRestartBackoffTimeStrategy
URL: https://github.com/apache/flink/pull/8698#discussion_r293341793
 
 

 ##########
 File path: flink-core/src/main/java/org/apache/flink/configuration/RestartBackoffTimeStrategyOptions.java
 ##########
 @@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.configuration;
+
+import org.apache.flink.annotation.PublicEvolving;
+
+/**
+ * Configuration options for the RestartBackoffTimeStrategy.
+ */
+@PublicEvolving
+public class RestartBackoffTimeStrategyOptions {
+	/**
+	 * Maximum number of failures in given time interval {@link #RESTART_BACKOFF_TIME_STRATEGY_FAILURE_RATE_FAILURE_RATE_INTERVAL}
+	 * before failing a job in FailureRateRestartBackoffTimeStrategy.
+	 */
+	@PublicEvolving
+	public static final ConfigOption<Integer> RESTART_BACKOFF_TIME_STRATEGY_FAILURE_RATE_MAX_FAILURES_PER_INTERVAL = ConfigOptions
+		.key("restart-backoff-time-strategy.failure-rate.max-failures-per-interval")
+		.defaultValue(1)
+		.withDescription("Maximum number of failures in given time interval before failing a job.");
+
+	/**
+	 * Time interval in which greater amount of failures than {@link #RESTART_BACKOFF_TIME_STRATEGY_FAILURE_RATE_MAX_FAILURES_PER_INTERVAL}
+	 * causes job fail in FailureRateRestartBackoffTimeStrategy. It can be specified using Scala's FiniteDuration notation: "1 min", "20 s"
+	 */
+	@PublicEvolving
+	public static final ConfigOption<String> RESTART_BACKOFF_TIME_STRATEGY_FAILURE_RATE_FAILURE_RATE_INTERVAL = ConfigOptions
+		.key("restart-backoff-time-strategy.failure-rate.failure-rate-interval")
+		.defaultValue("1 min")
+		.withDescription("Time interval for measuring failure rate.");
+
+	/**
+	 * Backoff time between two consecutive restart attempts in FailureRateRestartBackoffTimeStrategy.
+	 * It can be specified using Scala's FiniteDuration notation: "1 min", "20 s".
+	 */
+	@PublicEvolving
+	public static final ConfigOption<String> RESTART_BACKOFF_TIME_STRATEGY_FAILURE_RATE_FAILURE_RATE_BACKOFF_TIME = ConfigOptions
+		.key("restart-backoff-time-strategy.failure-rate.backoff-time")
+		.defaultValue("1 min")
+		.withDescription("Backoff time between two consecutive restart attempts.");
+
+	/**
+	 * Maximum number of attempts the fixed delay restart strategy will try before failing a job.
+	 */
+	@PublicEvolving
+	public static final ConfigOption<Integer> RESTART_BACKOFF_TIME_STRATEGY_FIXED_DELAY_ATTEMPTS = ConfigOptions
+		.key("restart-backoff-time-strategy.fixed-delay.attempts")
+		.defaultValue(1)
 
 Review comment:
   IMO, a large number would be better here, e.g. Int.Max. 
   Most of our Flink streaming customers would like the job to try more times before it fails. Especially when the cluster is not very stable.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services