peter-toth commented on code in PR #514:
URL:
https://github.com/apache/spark-kubernetes-operator/pull/514#discussion_r2890894368
##########
spark-operator-api/src/main/java/org/apache/spark/k8s/operator/status/AttemptInfo.java:
##########
@@ -40,13 +53,41 @@
public class AttemptInfo {
@Getter @Builder.Default protected final long id = 0L;
@Getter @Setter protected long restartCounter;
+ @Getter @Setter protected long failureRestartCounter;
+ @Getter @Setter protected long schedulingFailureRestartCounter;
/**
* Creates a new AttemptInfo object representing the next attempt.
- *
- * @return A new AttemptInfo with an incremented ID.
*/
- public AttemptInfo createNextAttemptInfo(boolean resetRestartCounter) {
- return new AttemptInfo(id + 1L, resetRestartCounter ? 1L : restartCounter
+ 1);
+ public AttemptInfo createNextAttemptInfo(
+ boolean resetRestartCounter, ApplicationStateSummary
currentStateSummary) {
+ long newRestartCounter = resetRestartCounter ? 1L : restartCounter + 1;
+ long newFailureCounter;
+ long newSchedulingFailureCounter;
+
+ if (resetRestartCounter) {
+ // Reset all counters when restart counter is reset
+ newRestartCounter = 1L;
Review Comment:
Actually, I've just tried combining the 2 logics, but it doesn't seem better
than the current solution.
--
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]