yuqi1129 commented on code in PR #7968:
URL: https://github.com/apache/gravitino/pull/7968#discussion_r2262152012
##########
core/src/main/java/org/apache/gravitino/job/local/LocalJobExecutor.java:
##########
@@ -255,15 +255,18 @@ public void runJob(Pair<String, JobTemplate> jobPair) {
try {
String jobId = jobPair.getLeft();
JobTemplate jobTemplate = jobPair.getRight();
+
+ Process process;
synchronized (lock) {
jobStatus.put(jobId, Pair.of(JobHandle.Status.STARTED,
UNEXPIRED_TIME_IN_MS));
- }
- LocalProcessBuilder processBuilder =
LocalProcessBuilder.create(jobTemplate, configs);
- Process process = processBuilder.start();
- runningProcesses.put(jobId, process);
+ LocalProcessBuilder processBuilder =
LocalProcessBuilder.create(jobTemplate, configs);
+ process = processBuilder.start();
+ runningProcesses.put(jobId, process);
Review Comment:
So, what is the root cause of CI failure? Based on your changes, the real
process and status changes are not within a lock.
##########
core/src/main/java/org/apache/gravitino/job/local/LocalJobExecutor.java:
##########
@@ -156,12 +156,12 @@ public String submitJob(JobTemplate jobTemplate) {
String newJobId = LOCAL_JOB_PREFIX + UUID.randomUUID();
Pair<String, JobTemplate> jobPair = Pair.of(newJobId, jobTemplate);
- // Add the job template to the waiting queue
- if (!waitingQueue.offer(jobPair)) {
- throw new IllegalStateException("Waiting queue is full, cannot submit
job: " + jobTemplate);
- }
-
synchronized (lock) {
Review Comment:
Does this operation need to be protected by the lock?
--
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]