morningman commented on code in PR #47974:
URL: https://github.com/apache/doris/pull/47974#discussion_r1959003029


##########
fe/fe-core/src/main/java/org/apache/doris/scheduler/manager/TransientTaskManager.java:
##########
@@ -63,10 +63,8 @@ public Long addMemoryTask(TransientTaskExecutor executor) 
throws JobException {
     }
 
     public void cancelMemoryTask(Long taskId) throws JobException {
-        try {
+        if (taskExecutorMap.containsKey(taskId)) {

Review Comment:
   I suggest to get the task from map first, and then check if it is null and 
do the cancel.
   Because the task may be removed after `containsKey()` and before `get()`,
   this 2 methods are not atomic



##########
fe/fe-core/src/main/java/org/apache/doris/load/ExportJob.java:
##########
@@ -713,7 +713,10 @@ private void 
cancelExportJobUnprotected(ExportFailMsg.CancelType type, String ms
         LOG.info("cancel export job {}", id);
     }
 
-    private void exportExportJob() {
+    private void exportExportJob() throws JobException {
+        if (getState() == ExportJobState.CANCELLED || getState() == 
ExportJobState.FINISHED) {
+            throw new JobException("export job has been cancelled or 
finished.");

Review Comment:
   Print the job state in error msg.



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to