This is an automated email from the ASF dual-hosted git repository.

dataroaring pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new 983d4c2fed5 branch-3.0: [fix](Export) Cancel the export job when the 
ring buffer have no enough slot #45244 (#45430)
983d4c2fed5 is described below

commit 983d4c2fed54324b368f5e83e05dd922bd162b06
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Dec 17 20:18:54 2024 +0800

    branch-3.0: [fix](Export) Cancel the export job when the ring buffer have 
no enough slot #45244 (#45430)
    
    Cherry-picked from #45244
    
    Co-authored-by: Tiewei Fang <fangtie...@selectdb.com>
---
 .../src/main/java/org/apache/doris/load/ExportMgr.java       | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/load/ExportMgr.java 
b/fe/fe-core/src/main/java/org/apache/doris/load/ExportMgr.java
index 238b40a7d41..b798c053186 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/load/ExportMgr.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/load/ExportMgr.java
@@ -120,8 +120,16 @@ public class ExportMgr {
                     job.getBrokerDesc());
         }
         // ATTN: Must add task after edit log, otherwise the job may finish 
before adding job.
-        for (int i = 0; i < job.getCopiedTaskExecutors().size(); i++) {
-            
Env.getCurrentEnv().getTransientTaskManager().addMemoryTask(job.getCopiedTaskExecutors().get(i));
+        try {
+            for (int i = 0; i < job.getCopiedTaskExecutors().size(); i++) {
+                
Env.getCurrentEnv().getTransientTaskManager().addMemoryTask(job.getCopiedTaskExecutors().get(i));
+            }
+        } catch (Exception e) {
+            // If there happens exceptions in `addMemoryTask`
+            // we must update the state of export job to `CANCELLED`
+            // because we have added this export in `ExportMgr`
+            job.updateExportJobState(ExportJobState.CANCELLED, 0L, null,
+                    ExportFailMsg.CancelType.RUN_FAIL, e.getMessage());
         }
         LOG.info("add export job. {}", job);
     }


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

Reply via email to