You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ta...@apache.org on 2023/04/06 08:47:31 UTC

[iotdb] branch fix_metric_local_scheduler created (now e88c6b0fe2)

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

tanxinyu pushed a change to branch fix_metric_local_scheduler
in repository https://gitbox.apache.org/repos/asf/iotdb.git


      at e88c6b0fe2 fix

This branch includes the following new commits:

     new e88c6b0fe2 fix

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: fix

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

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

commit e88c6b0fe2323112e20a46d49a2af71c07865b0b
Author: OneSizeFitQuorum <ta...@apache.org>
AuthorDate: Thu Apr 6 16:47:15 2023 +0800

    fix
    
    Signed-off-by: OneSizeFitQuorum <ta...@apache.org>
---
 .../scheduler/FragmentInstanceDispatcherImpl.java  | 30 ++++++++++++----------
 1 file changed, 16 insertions(+), 14 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/scheduler/FragmentInstanceDispatcherImpl.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/scheduler/FragmentInstanceDispatcherImpl.java
index b990e0e4fb..a471e9256a 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/scheduler/FragmentInstanceDispatcherImpl.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/scheduler/FragmentInstanceDispatcherImpl.java
@@ -182,22 +182,24 @@ public class FragmentInstanceDispatcherImpl implements IFragInstanceDispatcher {
 
     List<TSStatus> dataNodeFailureList = new ArrayList<>();
 
-    // sync dispatch to local
-    long localScheduleStartTime = System.nanoTime();
-    for (FragmentInstance localInstance : localInstances) {
-      try (SetThreadName threadName = new SetThreadName(localInstance.getId().getFullId())) {
-        dispatchOneInstance(localInstance);
-      } catch (FragmentInstanceDispatchException e) {
-        dataNodeFailureList.add(e.getFailureStatus());
-      } catch (Throwable t) {
-        logger.warn("[DispatchFailed]", t);
-        dataNodeFailureList.add(
-            RpcUtils.getStatus(
-                TSStatusCode.INTERNAL_SERVER_ERROR, "Unexpected errors: " + t.getMessage()));
+    if (!localInstances.isEmpty()) {
+      // sync dispatch to local
+      long localScheduleStartTime = System.nanoTime();
+      for (FragmentInstance localInstance : localInstances) {
+        try (SetThreadName threadName = new SetThreadName(localInstance.getId().getFullId())) {
+          dispatchOneInstance(localInstance);
+        } catch (FragmentInstanceDispatchException e) {
+          dataNodeFailureList.add(e.getFailureStatus());
+        } catch (Throwable t) {
+          logger.warn("[DispatchFailed]", t);
+          dataNodeFailureList.add(
+              RpcUtils.getStatus(
+                  TSStatusCode.INTERNAL_SERVER_ERROR, "Unexpected errors: " + t.getMessage()));
+        }
       }
+      PERFORMANCE_OVERVIEW_METRICS.recordScheduleLocalCost(
+          System.nanoTime() - localScheduleStartTime);
     }
-    PERFORMANCE_OVERVIEW_METRICS.recordScheduleLocalCost(
-        System.nanoTime() - localScheduleStartTime);
     // wait until remote dispatch done
     try {
       asyncPlanNodeSender.waitUntilCompleted();