You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2024/07/20 02:52:28 UTC
(doris) branch branch-2.1 updated: [Fix](JobManager)Release the lock immediately after modifying job metadata to avoid holding the lock for an extended period.#38162 (#38163)
This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.1 by this push:
new 87306858a1f [Fix](JobManager)Release the lock immediately after modifying job metadata to avoid holding the lock for an extended period.#38162 (#38163)
87306858a1f is described below
commit 87306858a1f6fbc00c12e183377a4890e0f7359c
Author: Calvin Kirs <ki...@apache.org>
AuthorDate: Sat Jul 20 10:52:21 2024 +0800
[Fix](JobManager)Release the lock immediately after modifying job metadata to avoid holding the lock for an extended period.#38162 (#38163)
## Proposed changes
#38162
<!--Describe your changes.-->
---
.../main/java/org/apache/doris/job/manager/JobManager.java | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/job/manager/JobManager.java b/fe/fe-core/src/main/java/org/apache/doris/job/manager/JobManager.java
index d8a30a968a6..39646bab18f 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/job/manager/JobManager.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/job/manager/JobManager.java
@@ -111,12 +111,19 @@ public class JobManager<T extends AbstractJob<?, C>, C> implements Writable {
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 {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org