You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by xi...@apache.org on 2021/03/02 04:12:04 UTC
[iotdb] 01/01: fix NPE bug in QueryTimeManager
This is an automated email from the ASF dual-hosted git repository.
xiangweiwei pushed a commit to branch fixQueryInfoNull
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit d71882781a2fc0a3eb358069d03d1546acaa03a3
Author: Alima777 <wx...@gmail.com>
AuthorDate: Tue Mar 2 12:11:27 2021 +0800
fix NPE bug in QueryTimeManager
---
.../java/org/apache/iotdb/db/query/control/QueryTimeManager.java | 5 ++---
1 file changed, 2 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 bfe2c70..4ce7204 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
@@ -24,7 +24,6 @@ import org.apache.iotdb.db.conf.IoTDBDescriptor;
import org.apache.iotdb.db.exception.query.QueryTimeoutRuntimeException;
import org.apache.iotdb.db.service.IService;
import org.apache.iotdb.db.service.ServiceType;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -102,8 +101,8 @@ public class QueryTimeManager implements IService {
}
public static void checkQueryAlive(long queryId) {
- if (getInstance().queryInfoMap.get(queryId) != null
- && getInstance().queryInfoMap.get(queryId).isInterrupted()) {
+ QueryInfo queryInfo = getInstance().queryInfoMap.get(queryId);
+ if (queryInfo != null && queryInfo.isInterrupted()) {
if (getInstance().unRegisterQuery(queryId).get()) {
throw new QueryTimeoutRuntimeException(
QueryTimeoutRuntimeException.TIMEOUT_EXCEPTION_MESSAGE);