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 <[email protected]> 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);
