You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2022/10/19 12:14:56 UTC

[iotdb] branch master updated: Make default timeout parameter in SessionIT from 1s to 60s (#7647)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 88903b3189 Make default timeout parameter in SessionIT from 1s to 60s (#7647)
88903b3189 is described below

commit 88903b3189e9cc6bd8b805a580e2bce4cd13361f
Author: Jackie Tien <ja...@gmail.com>
AuthorDate: Wed Oct 19 20:14:50 2022 +0800

    Make default timeout parameter in SessionIT from 1s to 60s (#7647)
---
 .../iotdb/session/it/IoTDBSessionInsertNulIT.java       |  2 +-
 .../iotdb/db/mpp/plan/execution/QueryExecution.java     | 17 +++++++++++------
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionInsertNulIT.java b/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionInsertNulIT.java
index 8243ffbe01..8853101160 100644
--- a/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionInsertNulIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/session/it/IoTDBSessionInsertNulIT.java
@@ -87,7 +87,7 @@ public class IoTDBSessionInsertNulIT {
 
   private long queryCountRecords(ISession session, String sql)
       throws StatementExecutionException, IoTDBConnectionException {
-    SessionDataSet dataSetWrapper = session.executeQueryStatement(sql, 1000);
+    SessionDataSet dataSetWrapper = session.executeQueryStatement(sql, 60_000);
     long count = 0;
     while (dataSetWrapper.hasNext()) {
       RowRecord record = dataSetWrapper.next();
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/execution/QueryExecution.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/execution/QueryExecution.java
index b525f1cf8f..697e265726 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/execution/QueryExecution.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/execution/QueryExecution.java
@@ -173,13 +173,18 @@ public class QueryExecution implements IQueryExecution {
       }
       return;
     }
-    long currentTime = System.currentTimeMillis();
-    long remainTime = context.getTimeOut() - (currentTime - context.getStartTime());
-    if (remainTime <= 0) {
-      throw new QueryTimeoutRuntimeException(
-          context.getStartTime(), currentTime, context.getTimeOut());
+
+    // only update query operation's timeout because we will never limit write operation's execution
+    // time
+    if (isQuery()) {
+      long currentTime = System.currentTimeMillis();
+      long remainTime = context.getTimeOut() - (currentTime - context.getStartTime());
+      if (remainTime <= 0) {
+        throw new QueryTimeoutRuntimeException(
+            context.getStartTime(), currentTime, context.getTimeOut());
+      }
+      context.setTimeOut(remainTime);
     }
-    context.setTimeOut(remainTime);
 
     doLogicalPlan();
     doDistributedPlan();