[FLINK-3800] [jobmanager] Terminate ExecutionGraphs properly
This PR terminates the ExecutionGraphs properly without restarts when the JobManager calls cancelAndClearEverything. It is achieved by allowing the method to be only called with an SuppressRestartsException. The SuppressRestartsException will disable the restart strategy of the respective ExecutionGraph. This is important because the root cause could be a different exception. In order to avoid race conditions, the restart strategy has to be checked twice whether it allwos to restart the job: Once before and once after the job has transitioned to the state RESTARTING. This avoids that ExecutionGraphs can become an orphan. Furhtermore, this PR fixes the problem that the default restart strategy is shared by multiple jobs. The problem is solved by introducing a RestartStrategyFactory which creates for every job its own instance of a RestartStrategy. Fix LeaderChangeJobRecoveryTest case This closes #1923.
Showing
想要评论请 注册 或 登录