viirya commented on code in PR #946:
URL: 
https://github.com/apache/spark-kubernetes-operator/pull/946#discussion_r4203548350


##########
spark-operator-api/src/main/java/org/apache/spark/k8s/operator/status/ApplicationStatus.java:
##########
@@ -205,10 +205,57 @@ public ApplicationStatus terminateOrRestart(
           currentAttemptSummary);
     }
 
-    ApplicationAttemptSummary nextAttemptSummary = new 
ApplicationAttemptSummary(nextAttemptInfo);
-    ApplicationState state =
-        new ApplicationState(ApplicationStateSummary.ScheduledToRestart, 
stateMessageOverride);
+    return startNextAttempt(
+        new ApplicationState(ApplicationStateSummary.ScheduledToRestart, 
stateMessageOverride),
+        nextAttemptInfo,
+        trimStateTransitionHistory);
+  }
+
+  /**
+   * Starts a new attempt of a suspended application which is resumed. Like a 
restart, the new

Review Comment:
   Non-blocking documentation suggestion: could we explicitly state that this 
method only constructs the next status and that callers must complete the 
required cleanup of the suspended attempt before starting the next one? This 
would make the caller's responsibility clear, similar to the resource-release 
precondition documented on `terminateOrRestart()`.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to