Skip to content

Commit

Permalink
fix comment
Browse files Browse the repository at this point in the history
Signed-off-by: luohaha <[email protected]>
  • Loading branch information
luohaha committed Jan 17, 2025
1 parent eefc701 commit 63d3799
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 16 deletions.
16 changes: 9 additions & 7 deletions fe/fe-core/src/main/java/com/starrocks/alter/AlterJobV2.java
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,7 @@ public long getWarehouseId() {
*/
public synchronized void run() {
if (isTimeout()) {
boolean cancelled = cancelImpl("Timeout");
cancelHook(cancelled);
if (cancelled) {
if (cancelInternal("Timeout")) {
// If this job can't be cancelled, we should execute it.
return;
}
Expand Down Expand Up @@ -259,15 +257,19 @@ public synchronized void run() {
} // else: handle the new state
}
} catch (AlterCancelException e) {
cancelHook(cancelImpl(e.getMessage()));
cancelInternal(e.getMessage());
}
}

protected boolean cancelInternal(String errMsg) {
boolean cancelled = cancelImpl(errMsg);
cancelHook(cancelled);
return cancelled;
}

public boolean cancel(String errMsg) {
synchronized (this) {
boolean cancelled = cancelImpl(errMsg);
cancelHook(cancelled);
return cancelled;
return cancelInternal(errMsg);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1080,9 +1080,7 @@ public final boolean cancel(String errMsg) {
createReplicaLatch.countDownToZero(new Status(TStatusCode.OK, ""));
}
synchronized (this) {
boolean cancelled = cancelImpl(errMsg);
cancelHook(cancelled);
return cancelled;
return cancelInternal(errMsg);
}
} finally {
isCancelling.set(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -770,9 +770,7 @@ public final boolean cancel(String errMsg) {
createReplicaLatch.countDownToZero(new Status(TStatusCode.OK, ""));
}
synchronized (this) {
boolean cancelled = cancelImpl(errMsg);
cancelHook(cancelled);
return cancelled;
return cancelInternal(errMsg)
}
} finally {
isCancelling.set(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -946,9 +946,7 @@ public final boolean cancel(String errMsg) {
createReplicaLatch.countDownToZero(new Status(TStatusCode.OK, ""));
}
synchronized (this) {
boolean cancelled = cancelImpl(errMsg);
cancelHook(cancelled);
return cancelled;
return cancelInternal(errMsg);
}
} finally {
isCancelling.set(false);
Expand Down

0 comments on commit 63d3799

Please sign in to comment.