jerryshao commented on code in PR #7874:
URL: https://github.com/apache/gravitino/pull/7874#discussion_r2250332958
##########
core/src/main/java/org/apache/gravitino/job/JobManager.java:
##########
@@ -366,15 +370,20 @@ public JobEntity cancelJob(String metalake, String jobId)
throws NoSuchJobExcept
.withLastModifiedTime(Instant.now())
.build())
.build();
-
- try {
- // Update the job entity in the entity store
- entityStore.put(newJobEntity, true /* overwrite */);
- return newJobEntity;
- } catch (IOException e) {
- throw new RuntimeException(
- String.format("Failed to update job entity %s to CANCELING status",
newJobEntity), e);
- }
+ return TreeLockUtils.doWithTreeLock(
+ NameIdentifierUtil.ofJob(metalake, jobId),
+ LockType.WRITE,
+ () -> {
+ try {
+ // Update the job entity in the entity store
+ entityStore.put(newJobEntity, true /* overwrite */);
Review Comment:
This will be in another PR.
--
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]