dmvk commented on a change in pull request #18689:
URL: https://github.com/apache/flink/pull/18689#discussion_r803790449



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptive/StateWithExecutionGraph.java
##########
@@ -148,6 +162,33 @@ public Logger getLogger() {
         return logger;
     }
 
+    protected Throwable extractError(TaskExecutionStateTransition 
taskExecutionStateTransition) {
+        Throwable cause = 
taskExecutionStateTransition.getError(userCodeClassLoader);
+        if (cause == null) {
+            cause = new FlinkException("Unknown failure cause. Probably 
related to FLINK-21376.");
+        }
+        return cause;
+    }
+
+    protected Optional<ExecutionVertexID> extractExecutionVertexID(
+            TaskExecutionStateTransition taskExecutionStateTransition) {
+        return 
executionGraph.getExecutionVertexId(taskExecutionStateTransition.getID());
+    }
+
+    protected static Optional<RootExceptionHistoryEntry> convertFailures(
+            Function<ExecutionVertexID, Optional<ExecutionVertex>> lookup,
+            List<Failure> failureCollection) {
+        if (failureCollection.isEmpty()) {
+            return Optional.empty();
+        }
+        Failure first = failureCollection.remove(0);
+        Set<ExceptionHistoryEntry> entries = new HashSet<>();
+        for (Failure failure : failureCollection) {
+            entries.add(failure.toExceptionHistoryEntry(lookup));

Review comment:
       I guess it could happen if TM doesn't get the ack response from the JM 
(some kind of transient network failure). But I'm not really sure whether TM 
retries than.
   
   If it adds too much complexity I think it's OK not to bother with that. 
Maybe we should just use `List` instead of `Set` for collecting the entries to 
make the fact that we're not trying to be smart explicit.




-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to