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

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


The following commit(s) were added to refs/heads/master by this push:
     new 5f9c6e076f [Fix](load)Make insert timeout accurate in `show load` 
statistics  (#20068)
5f9c6e076f is described below

commit 5f9c6e076fee5c34fa7e6583fc320ca498ec8207
Author: Changming Xiao <[email protected]>
AuthorDate: Sun May 28 21:19:06 2023 +0800

    [Fix](load)Make insert timeout accurate in `show load` statistics  (#20068)
---
 docs/en/docs/data-operate/import/import-way/insert-into-manual.md    | 2 +-
 docs/zh-CN/docs/data-operate/import/import-way/insert-into-manual.md | 2 +-
 fe/fe-common/src/main/java/org/apache/doris/common/Config.java       | 2 +-
 fe/fe-core/src/main/java/org/apache/doris/load/loadv2/LoadJob.java   | 5 ++++-
 4 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/docs/en/docs/data-operate/import/import-way/insert-into-manual.md 
b/docs/en/docs/data-operate/import/import-way/insert-into-manual.md
index be12523aa2..57b4fc415f 100644
--- a/docs/en/docs/data-operate/import/import-way/insert-into-manual.md
+++ b/docs/en/docs/data-operate/import/import-way/insert-into-manual.md
@@ -187,7 +187,7 @@ This command returns the insert results and the details of 
the corresponding tra
 
   The timeout time of the import task (in seconds) will be cancelled by the 
system if the import task is not completed within the set timeout time, and 
will become CANCELLED.
 
-  At present, Insert Into does not support custom import timeout time. All 
Insert Into imports have a uniform timeout time. The default timeout time is 1 
hour. If the imported source file cannot complete the import within the 
specified time, the parameter `insert_load_default_timeout_second` of FE needs 
to be adjusted.
+  At present, Insert Into does not support custom import timeout time. All 
Insert Into imports have a uniform timeout time. The default timeout time is 4 
hours. If the imported source file cannot complete the import within the 
specified time, the parameter `insert_load_default_timeout_second` of FE needs 
to be adjusted.
 
   <version since="dev"></version>
   At the same time, the Insert Into statement receives the restriction of the 
Session variable `insert_timeout`. You can increase the timeout time by `SET 
insert_timeout = xxx;` in seconds.
diff --git 
a/docs/zh-CN/docs/data-operate/import/import-way/insert-into-manual.md 
b/docs/zh-CN/docs/data-operate/import/import-way/insert-into-manual.md
index 842cfa0400..a9daf9a219 100644
--- a/docs/zh-CN/docs/data-operate/import/import-way/insert-into-manual.md
+++ b/docs/zh-CN/docs/data-operate/import/import-way/insert-into-manual.md
@@ -190,7 +190,7 @@ TransactionStatus: VISIBLE
 
   导入任务的超时时间(以秒为单位),导入任务在设定的 timeout 时间内未完成则会被系统取消,变成 CANCELLED。
 
-  目前 Insert Into 并不支持自定义导入的 timeout 时间,所有 Insert Into 导入的超时时间是统一的,默认的 timeout 
时间为1小时。如果导入的源文件无法在规定时间内完成导入,则需要调整 FE 
的参数```insert_load_default_timeout_second```。
+  目前 Insert Into 并不支持自定义导入的 timeout 时间,所有 Insert Into 导入的超时时间是统一的,默认的 timeout 
时间为4小时。如果导入的源文件无法在规定时间内完成导入,则需要调整 FE 
的参数```insert_load_default_timeout_second```。
   
   <version since="dev"></version>
   同时 Insert Into 语句受到 Session 变量 `insert_timeout`的限制。可以通过 `SET insert_timeout 
= xxx;` 来增加超时时间,单位是秒。
diff --git a/fe/fe-common/src/main/java/org/apache/doris/common/Config.java 
b/fe/fe-common/src/main/java/org/apache/doris/common/Config.java
index b867de62e8..aaac83b099 100644
--- a/fe/fe-common/src/main/java/org/apache/doris/common/Config.java
+++ b/fe/fe-common/src/main/java/org/apache/doris/common/Config.java
@@ -452,7 +452,7 @@ public class Config extends ConfigBase {
 
     @ConfField(mutable = true, masterOnly = true, description = {"Insert load 
的默认超时时间,单位是秒。",
             "Default timeout for insert load job, in seconds."})
-    public static int insert_load_default_timeout_second = 3600; // 1 hour
+    public static int insert_load_default_timeout_second = 14400; // 4 hour
 
     @ConfField(mutable = true, masterOnly = true, description = {"Stream load 
的默认超时时间,单位是秒。",
             "Default timeout for stream load job, in seconds."})
diff --git a/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/LoadJob.java 
b/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/LoadJob.java
index 1089e01059..010f6d5765 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/LoadJob.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/LoadJob.java
@@ -77,6 +77,7 @@ import java.io.DataOutput;
 import java.io.IOException;
 import java.util.List;
 import java.util.Map;
+import java.util.Optional;
 import java.util.Set;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
@@ -415,7 +416,9 @@ public abstract class LoadJob extends 
AbstractTxnStateChangeCallback implements
                 timeout = Config.broker_load_default_timeout_second;
                 break;
             case INSERT:
-                timeout = Config.insert_load_default_timeout_second;
+                timeout = Optional.ofNullable(ConnectContext.get())
+                                    .map(ConnectContext::getExecTimeout)
+                                    
.orElse(Config.insert_load_default_timeout_second);
                 break;
             case MINI:
                 timeout = Config.stream_load_default_timeout_second;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to