You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ml...@apache.org on 2015/04/15 17:17:42 UTC

git commit: updated refs/heads/master to 5506ec9

Repository: cloudstack
Updated Branches:
  refs/heads/master 8558adb50 -> 5506ec993


CLOUDSTACK-8387 - Don't autoclose new mgmt server peer connections as soon as they open


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/5506ec99
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/5506ec99
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/5506ec99

Branch: refs/heads/master
Commit: 5506ec993689f7283f5f9e8cf9c87c6857cba7e2
Parents: 8558adb
Author: MS <m...@turboio.com>
Authored: Wed Apr 15 08:08:10 2015 -0700
Committer: Marcus Sorensen <ma...@apple.com>
Committed: Wed Apr 15 08:16:33 2015 -0700

----------------------------------------------------------------------
 .../src/com/cloud/agent/manager/ClusteredAgentManagerImpl.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5506ec99/engine/orchestration/src/com/cloud/agent/manager/ClusteredAgentManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/agent/manager/ClusteredAgentManagerImpl.java b/engine/orchestration/src/com/cloud/agent/manager/ClusteredAgentManagerImpl.java
index e38489b..2417f4d 100644
--- a/engine/orchestration/src/com/cloud/agent/manager/ClusteredAgentManagerImpl.java
+++ b/engine/orchestration/src/com/cloud/agent/manager/ClusteredAgentManagerImpl.java
@@ -498,7 +498,8 @@ public class ClusteredAgentManagerImpl extends AgentManagerImpl implements Clust
                 } catch (UnknownHostException e) {
                     throw new CloudRuntimeException("Unable to resolve " + ip);
                 }
-                try (SocketChannel ch1 = SocketChannel.open(new InetSocketAddress(addr, Port.value()));){
+                try {
+                    SocketChannel ch1 = SocketChannel.open(new InetSocketAddress(addr, Port.value()));
                     ch1.configureBlocking(true); // make sure we are working at blocking mode
                     ch1.socket().setKeepAlive(true);
                     ch1.socket().setSoTimeout(60 * 1000);
@@ -516,8 +517,9 @@ public class ClusteredAgentManagerImpl extends AgentManagerImpl implements Clust
                     if (s_logger.isDebugEnabled()) {
                         s_logger.debug("Connection to peer opened: " + peerName + ", ip: " + ip);
                     }
-                    _peers.put(peerName, ch);
+                    _peers.put(peerName, ch1);
                     _sslEngines.put(peerName, sslEngine);
+                    return ch1;
                 } catch (IOException e) {
                     s_logger.warn("Unable to connect to peer management server: " + peerName + ", ip: " + ip + " due to " + e.getMessage(), e);
                     return null;