[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-8387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14496328#comment-14496328
 ] 

ASF subversion and git services commented on CLOUDSTACK-8387:
-------------------------------------------------------------

Commit 5506ec993689f7283f5f9e8cf9c87c6857cba7e2 in cloudstack's branch 
refs/heads/master from MS
[ https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;h=5506ec9 ]

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


> 4.5, master mgmt cluster nodes fail to connect
> ----------------------------------------------
>
>                 Key: CLOUDSTACK-8387
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-8387
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the 
> default.) 
>          Components: Management Server
>    Affects Versions: Future, 4.5.0, 4.5.1
>            Reporter: Marcus Sorensen
>
> A recent fix for coverity changed the SSL connection initialization between 
> mgmt servers to return a null channel, by setting up a new channel and not 
> returning it. This patch needs to be reverted or fixed.
> Note this method returns 'ch', but the patch sets up 'ch1' and does not 
> return it.
> diff --git 
> a/engine/orchestration/src/com/cloud/agent/manager/ClusteredAgentManagerImpl.java
> b/engine/orchestration/src/com/cloud/agent/manager/ClusteredAgentManagerImpl.java
> index 600dca2..e38489b 100755
> --- 
> a/engine/orchestration/src/com/cloud/agent/manager/ClusteredAgentManagerImpl.java
> +++ 
> b/engine/orchestration/src/com/cloud/agent/manager/ClusteredAgentManagerImpl.java
> @@ -498,18 +498,17 @@ public class ClusteredAgentManagerImpl extends
> AgentManagerImpl implements Clust
>                  } catch (UnknownHostException e) {
>                      throw new CloudRuntimeException("Unable to resolve " + 
> ip);
>                  }
> -                try {
> -                    ch = SocketChannel.open(new
> InetSocketAddress(addr, Port.value()));
> -                    ch.configureBlocking(true); // make sure we are
> working at blocking mode
> -                    ch.socket().setKeepAlive(true);
> -                    ch.socket().setSoTimeout(60 * 1000);
> +                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);
>                      try {
>                          SSLContext sslContext = Link.initSSLContext(true);
>                          sslEngine = sslContext.createSSLEngine(ip,
> Port.value());
>                          sslEngine.setUseClientMode(true);
> sslEngine.setEnabledProtocols(SSLUtils.getSupportedProtocols(sslEngine.getEnabledProtocols()));
> -                        Link.doHandshake(ch, sslEngine, true);
> +                        Link.doHandshake(ch1, sslEngine, true);
>                          s_logger.info("SSL: Handshake done");
>                      } catch (Exception e) {
>                          throw new IOException("SSL: Fail to init SSL! " + e);



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to