Skip to content

Commit

Permalink
[Hotfix][Zeta] Avoid Redundant Job Submissions by Checking Job Status (
Browse files Browse the repository at this point in the history
  • Loading branch information
ic4y authored Aug 9, 2023
1 parent faeab89 commit 87a4fa6
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,18 @@ public ResourceManager getResourceManager() {
/** call by client to submit job */
public PassiveCompletableFuture<Void> submitJob(long jobId, Data jobImmutableInformation) {
CompletableFuture<Void> jobSubmitFuture = new CompletableFuture<>();

// Check if the current jobID is already running. If so, complete the submission
// successfully.
// This avoids potential issues like redundant job restores or other anomalies.
if (getJobMaster(jobId) != null) {
logger.warning(
String.format(
"The job %s is currently running; no need to submit again.", jobId));
jobSubmitFuture.complete(null);
return new PassiveCompletableFuture<>(jobSubmitFuture);
}

JobMaster jobMaster =
new JobMaster(
jobImmutableInformation,
Expand Down

0 comments on commit 87a4fa6

Please sign in to comment.