You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ja...@apache.org on 2022/08/15 02:08:14 UTC

[iotdb] branch IOTDB-4127 created (now 93f41b5c76)

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

jackietien pushed a change to branch IOTDB-4127
in repository https://gitbox.apache.org/repos/asf/iotdb.git


      at 93f41b5c76 [IOTDB-4127] Fix NPE bug in AbstractFragInsStateTracker

This branch includes the following new commits:

     new 93f41b5c76 [IOTDB-4127] Fix NPE bug in AbstractFragInsStateTracker

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[iotdb] 01/01: [IOTDB-4127] Fix NPE bug in AbstractFragInsStateTracker

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch IOTDB-4127
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 93f41b5c764fc7c3845419297b6a63247df96ae7
Author: JackieTien97 <ja...@gmail.com>
AuthorDate: Mon Aug 15 10:08:01 2022 +0800

    [IOTDB-4127] Fix NPE bug in AbstractFragInsStateTracker
---
 .../iotdb/db/mpp/plan/scheduler/AbstractFragInsStateTracker.java | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/scheduler/AbstractFragInsStateTracker.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/scheduler/AbstractFragInsStateTracker.java
index eb77ef7587..c2233d8da0 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/scheduler/AbstractFragInsStateTracker.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/scheduler/AbstractFragInsStateTracker.java
@@ -24,6 +24,7 @@ import org.apache.iotdb.commons.client.IClientManager;
 import org.apache.iotdb.commons.client.sync.SyncDataNodeInternalServiceClient;
 import org.apache.iotdb.db.conf.IoTDBDescriptor;
 import org.apache.iotdb.db.mpp.execution.QueryStateMachine;
+import org.apache.iotdb.db.mpp.execution.fragment.FragmentInstanceInfo;
 import org.apache.iotdb.db.mpp.execution.fragment.FragmentInstanceManager;
 import org.apache.iotdb.db.mpp.execution.fragment.FragmentInstanceState;
 import org.apache.iotdb.db.mpp.plan.planner.plan.FragmentInstance;
@@ -69,7 +70,13 @@ public abstract class AbstractFragInsStateTracker implements IFragInstanceStateT
       throws TException, IOException {
     TEndPoint endPoint = instance.getHostDataNode().internalEndPoint;
     if (isInstanceRunningLocally(endPoint)) {
-      return FragmentInstanceManager.getInstance().getInstanceInfo(instance.getId()).getState();
+      FragmentInstanceInfo info =
+          FragmentInstanceManager.getInstance().getInstanceInfo(instance.getId());
+      if (info != null) {
+        return info.getState();
+      } else {
+        return FragmentInstanceState.NO_SUCH_INSTANCE;
+      }
     } else {
       try (SyncDataNodeInternalServiceClient client =
           internalServiceClientManager.borrowClient(endPoint)) {