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

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


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new f54502960c0 [fix](branch-2.1) Cacel the export job when the ring 
buffer have no enough slot (#45245)
f54502960c0 is described below

commit f54502960c099d3f2e8e7dfa1da7208a89e146ad
Author: Tiewei Fang <fangtie...@selectdb.com>
AuthorDate: Wed Dec 11 14:34:14 2024 +0800

    [fix](branch-2.1) Cacel the export job when the ring buffer have no enough 
slot (#45245)
---
 .../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 5ee68045b9f..99bb538d59e 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
@@ -116,8 +116,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