XComp commented on code in PR #24382:
URL: https://github.com/apache/flink/pull/24382#discussion_r1502888533


##########
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/DefaultExecutionGraph.java:
##########
@@ -1031,34 +1028,18 @@ public void suspend(Throwable suspensionCause) {
             return;
         } else if (transitionState(state, JobStatus.SUSPENDED, 
suspensionCause)) {
             initFailureCause(suspensionCause, System.currentTimeMillis());
+            resetExecutionGraph(ExecutionJobVertex::suspend)
+                    .whenComplete(
+                            (Void ignored, Throwable throwable) -> {
+                                if (throwable != null) {
+                                    LOG.debug(
+                                            "Could not properly suspend the 
execution graph.",
+                                            throwable);
+                                }
 
-            incrementRestarts();
-
-            // cancel ongoing scheduling action
-            if (schedulingFuture != null) {
-                schedulingFuture.cancel(false);
-            }
-            final ArrayList<CompletableFuture<Void>> 
executionJobVertexTerminationFutures =
-                    new ArrayList<>(verticesInCreationOrder.size());
-
-            for (ExecutionJobVertex ejv : verticesInCreationOrder) {
-                executionJobVertexTerminationFutures.add(ejv.suspend());
-            }
-
-            final ConjunctFuture<Void> jobVerticesTerminationFuture =
-                    
FutureUtils.waitForAll(executionJobVertexTerminationFutures);
-
-            checkState(jobVerticesTerminationFuture.isDone(), "Suspend needs 
to happen atomically");

Review Comment:
   :facepalm: I was tricked into assuming asynchronous execution due to the 
method name. [I fixed 
it](https://github.com/apache/flink/compare/e71224d683351e13f45ac76c2044be72b31463b4..3176a981a1692542fef60ebad55d1b80e60c8d60).



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