Skip to content

Restart Strategies

  • Fixed Delay Restart Strategy


val env = ExecutionEnvironment.getExecutionEnvironment()
  3, // The number of times that Flink retries the execution before the job is declared as failed.
  Time.of(10, TimeUnit.SECONDS) // Delaying the retry means that after a failed execution, the re-execution does not start immediately, but only after a certain delay. Delaying the retries can be helpful when the program interacts with external systems where for example connections or pending transactions should reach a timeout before re-execution is attempted.
  • Failure Rate Restart Strategy


val env = ExecutionEnvironment.getExecutionEnvironment()
  3, // Maximum number of restarts in given time interval before failing a job
  Time.of(5, TimeUnit.MINUTES), // Time interval for measuring failure rate
  Time.of(10, TimeUnit.SECONDS) // Delay between two consecutive restart attempts
  • No Restart Strategy


val env = ExecutionEnvironment.getExecutionEnvironment()
  • Fallback Restart Strategy

集群默认重启策略,默认为Fixed Delay Restart Strategy(1 or Integer.MAX_VALUE, akka.ask.timeout or 10s)