Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix](JobManager)Release the lock immediately after modifying job metadata to avoid holding the lock for an extended period.#38162 #38163

Merged
merged 1 commit into from
Jul 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,19 @@ public void registerJob(T job) throws JobException {
throw new JobException("job id exist, jobId:" + job.getJobId());
}
jobMap.put(job.getJobId(), job);
//check its need to scheduler
jobScheduler.scheduleOneJob(job);
job.logCreateOperation();
} finally {
writeUnlock();
}
try {
//check its need to scheduler
jobScheduler.scheduleOneJob(job);
} catch (Exception e) {
// if scheduler job error, we need to unregister job
log.warn(("first schedule job error,unregister job, jobName:" + job.getJobName()), e);
unregisterJob(job.getJobId());
throw new JobException("register job error, jobName:" + job.getJobName());
}
}

private void checkJobNameExist(String jobName) throws JobException {
Expand Down
Loading