jerryshao commented on code in PR #7968:
URL: https://github.com/apache/gravitino/pull/7968#discussion_r2262161150
##########
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:
The main reason is the process is started before the status is changed to
"queue", so the fetched status is always "queue".
--
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]