[hotfix] Abort restore when the procedure failed through with a closed 
CloseableRegistry

This prevents that exceptions from cancellation through the CloseableRegistry 
will result in
unnecessary recovery attemps with alternative state.


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/a7b54f12
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/a7b54f12
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/a7b54f12

Branch: refs/heads/master
Commit: a7b54f12c96bf03fd87b4cf03127f0838e746695
Parents: 85eb104
Author: Stefan Richter <[email protected]>
Authored: Mon Mar 12 22:43:47 2018 +0100
Committer: Stefan Richter <[email protected]>
Committed: Thu May 17 10:03:03 2018 +0200

----------------------------------------------------------------------
 .../flink/streaming/api/operators/BackendRestorerProcedure.java  | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/a7b54f12/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/BackendRestorerProcedure.java
----------------------------------------------------------------------
diff --git 
a/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/BackendRestorerProcedure.java
 
b/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/BackendRestorerProcedure.java
index dd75fb2..0f5b0e0 100644
--- 
a/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/BackendRestorerProcedure.java
+++ 
b/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/BackendRestorerProcedure.java
@@ -125,6 +125,10 @@ public class BackendRestorerProcedure<
 
                                LOG.warn("Exception while restoring {} from 
alternative ({}/{}), will retry while more " +
                                        "alternatives are available.", 
logDescription, alternativeIdx, restoreOptions.size(), ex);
+
+                               if (backendCloseableRegistry.isClosed()) {
+                                       throw new FlinkException("Stopping 
restore attempts for already cancelled task.", collectedException);
+                               }
                        }
                }
 

Reply via email to