You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by ji...@apache.org on 2022/04/18 09:51:11 UTC

[incubator-doris-manager] branch master updated: fix variable param is used in multi threads (#48)

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

jiafengzheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris-manager.git


The following commit(s) were added to refs/heads/master by this push:
     new e87035e  fix variable param is used in multi threads (#48)
e87035e is described below

commit e87035e5aa65a9a5d0f47a588a911f86877968bd
Author: LiRui <11...@qq.com>
AuthorDate: Mon Apr 18 17:51:08 2022 +0800

    fix variable param is used in multi threads (#48)
    
    fix variable param is used in multi threads
---
 .../stack/control/manager/ResourceClusterManager.java      | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/manager/dm-server/src/main/java/org/apache/doris/stack/control/manager/ResourceClusterManager.java b/manager/dm-server/src/main/java/org/apache/doris/stack/control/manager/ResourceClusterManager.java
index 75fd80b..d7e13c7 100644
--- a/manager/dm-server/src/main/java/org/apache/doris/stack/control/manager/ResourceClusterManager.java
+++ b/manager/dm-server/src/main/java/org/apache/doris/stack/control/manager/ResourceClusterManager.java
@@ -115,10 +115,6 @@ public class ResourceClusterManager {
                 PMResourceClusterAccessInfo.class);
         // TODO:The path can be set separately for each machine later
         List<ResourceNodeEntity> nodeEntities = nodeRepository.getByResourceClusterId(resourceClusterId);
-        AgentInstallEventConfigInfo configInfo = new AgentInstallEventConfigInfo();
-        configInfo.setSshUser(accessInfo.getSshUser());
-        configInfo.setSshPort(accessInfo.getSshPort());
-        configInfo.setSshKey(accessInfo.getSshKey());
 
         log.debug("check agent port for resource cluster {} all nodes", resourceClusterId);
 
@@ -127,6 +123,11 @@ public class ResourceClusterManager {
         // but it may expose this problem early if the port has been used.
         List<Pair<ResourceNodeEntity, CompletableFuture<Boolean>>> nodeFutures = new ArrayList<>();
         for (ResourceNodeEntity nodeEntity : nodeEntities) {
+            AgentInstallEventConfigInfo configInfo = new AgentInstallEventConfigInfo();
+            configInfo.setSshUser(accessInfo.getSshUser());
+            configInfo.setSshPort(accessInfo.getSshPort());
+            configInfo.setSshKey(accessInfo.getSshKey());
+
             CompletableFuture<Boolean> portCheckFuture = CompletableFuture.supplyAsync(() -> {
                 try {
                     nodeAndAgentManager.checkSshConnect(nodeEntity, configInfo);
@@ -169,6 +170,11 @@ public class ResourceClusterManager {
         log.debug("install agent for resource cluster {} all nodes", resourceClusterId);
         for (ResourceNodeEntity nodeEntity : nodeEntities) {
             log.info("start to install agent to {} node {}", nodeEntity.getId(), nodeEntity.getHost());
+            AgentInstallEventConfigInfo configInfo = new AgentInstallEventConfigInfo();
+            configInfo.setSshUser(accessInfo.getSshUser());
+            configInfo.setSshPort(accessInfo.getSshPort());
+            configInfo.setSshKey(accessInfo.getSshKey());
+
             nodeAndAgentManager.installAgentOperation(nodeEntity, configInfo, requestId);
         }
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org