You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2021/01/21 08:43:04 UTC
[iotdb] branch master updated: add timeout Log (#2537)
This is an automated email from the ASF dual-hosted git repository.
qiaojialin 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 bc91dd5 add timeout Log (#2537)
bc91dd5 is described below
commit bc91dd598489d8589e510d236a042842870ebd95
Author: Xiangwei Wei <34...@users.noreply.github.com>
AuthorDate: Thu Jan 21 16:42:26 2021 +0800
add timeout Log (#2537)
---
.../java/org/apache/iotdb/db/query/control/QueryTimeManager.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/server/src/main/java/org/apache/iotdb/db/query/control/QueryTimeManager.java b/server/src/main/java/org/apache/iotdb/db/query/control/QueryTimeManager.java
index 97e7860..f8f35b4 100644
--- a/server/src/main/java/org/apache/iotdb/db/query/control/QueryTimeManager.java
+++ b/server/src/main/java/org/apache/iotdb/db/query/control/QueryTimeManager.java
@@ -61,13 +61,13 @@ public class QueryTimeManager implements IService {
}
public void registerQuery(long queryId, long startTime, String sql, long timeout) {
- timeout = timeout == 0 ? config.getQueryTimeThreshold() : timeout;
+ final long finalTimeout = timeout == 0 ? config.getQueryTimeThreshold() : timeout;
queryInfoMap.put(queryId, new QueryInfo(startTime, sql));
// submit a scheduled task to judge whether query is still running after timeout
ScheduledFuture<?> scheduledFuture = executorService.schedule(() -> {
killQuery(queryId);
- logger.warn(String.format("Query is time out with queryId %d", queryId));
- }, timeout, TimeUnit.MILLISECONDS);
+ logger.warn(String.format("Query is time out (%dms) with queryId %d", finalTimeout, queryId));
+ }, finalTimeout, TimeUnit.MILLISECONDS);
queryScheduledTaskMap.put(queryId, scheduledFuture);
}