From 5b6fbe6aebbe9cd24dfebe9271ecb5dc40877c94 Mon Sep 17 00:00:00 2001 From: Simon Weller Date: Mon, 7 Mar 2016 16:23:35 -0600 Subject: [PATCH 1/3] Cloudstack 9285 for 4.7.x --- agent/src/com/cloud/agent/Agent.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/agent/src/com/cloud/agent/Agent.java b/agent/src/com/cloud/agent/Agent.java index 994e8224894..912d3088e1c 100644 --- a/agent/src/com/cloud/agent/Agent.java +++ b/agent/src/com/cloud/agent/Agent.java @@ -412,7 +412,8 @@ public class Agent implements HandlerFactory, IAgentControl { try { _connection.start(); } catch (final NioConnectionException e) { - throw new CloudRuntimeException("Unable to start the connection!", e); + s_logger.info("Attempted to connect to the server, but received an unexpected exception, trying again..."); + } _shell.getBackoffAlgorithm().waitBeforeRetry(); } while (!_connection.isStartup()); From c69a2428977aed7df497a479a7e802e9d8d0e922 Mon Sep 17 00:00:00 2001 From: Simon Weller Date: Tue, 8 Mar 2016 09:14:07 -0600 Subject: [PATCH 2/3] CLOUDSTACK-9285 - Address original on start exception(s) and newline cleanup --- agent/src/com/cloud/agent/Agent.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/agent/src/com/cloud/agent/Agent.java b/agent/src/com/cloud/agent/Agent.java index 912d3088e1c..7e0a4356aa2 100644 --- a/agent/src/com/cloud/agent/Agent.java +++ b/agent/src/com/cloud/agent/Agent.java @@ -227,7 +227,7 @@ public class Agent implements HandlerFactory, IAgentControl { try { _connection.start(); } catch (final NioConnectionException e) { - throw new CloudRuntimeException("Unable to start the connection!", e); + s_logger.info("Attempted to connect to the server, but received an unexpected exception, trying again..."); } while (!_connection.isStartup()) { _shell.getBackoffAlgorithm().waitBeforeRetry(); @@ -235,7 +235,7 @@ public class Agent implements HandlerFactory, IAgentControl { try { _connection.start(); } catch (final NioConnectionException e) { - throw new CloudRuntimeException("Unable to start the connection!", e); + s_logger.info("Attempted to connect to the server, but received an unexpected exception, trying again..."); } } } @@ -413,7 +413,6 @@ public class Agent implements HandlerFactory, IAgentControl { _connection.start(); } catch (final NioConnectionException e) { s_logger.info("Attempted to connect to the server, but received an unexpected exception, trying again..."); - } _shell.getBackoffAlgorithm().waitBeforeRetry(); } while (!_connection.isStartup()); From 3683dff493e2493ac3f1ac0b572e8b21361c2134 Mon Sep 17 00:00:00 2001 From: Simon Weller Date: Mon, 7 Mar 2016 16:23:35 -0600 Subject: [PATCH 3/3] Cloudstack 9285 for 4.7.x --- agent/src/com/cloud/agent/Agent.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/agent/src/com/cloud/agent/Agent.java b/agent/src/com/cloud/agent/Agent.java index 994e8224894..2dee5a4e687 100644 --- a/agent/src/com/cloud/agent/Agent.java +++ b/agent/src/com/cloud/agent/Agent.java @@ -227,7 +227,7 @@ public class Agent implements HandlerFactory, IAgentControl { try { _connection.start(); } catch (final NioConnectionException e) { - throw new CloudRuntimeException("Unable to start the connection!", e); + s_logger.info("Attempted to connect to the server, but received an unexpected exception, trying again..."); } while (!_connection.isStartup()) { _shell.getBackoffAlgorithm().waitBeforeRetry(); @@ -235,7 +235,7 @@ public class Agent implements HandlerFactory, IAgentControl { try { _connection.start(); } catch (final NioConnectionException e) { - throw new CloudRuntimeException("Unable to start the connection!", e); + s_logger.info("Attempted to connect to the server, but received an unexpected exception, trying again..."); } } } @@ -412,7 +412,7 @@ public class Agent implements HandlerFactory, IAgentControl { try { _connection.start(); } catch (final NioConnectionException e) { - throw new CloudRuntimeException("Unable to start the connection!", e); + s_logger.info("Attempted to connect to the server, but received an unexpected exception, trying again..."); } _shell.getBackoffAlgorithm().waitBeforeRetry(); } while (!_connection.isStartup());