|
52 | 52 | import org.apache.cloudstack.managed.context.ManagedContextRunnable; |
53 | 53 | import org.apache.cloudstack.outofbandmanagement.dao.OutOfBandManagementDao; |
54 | 54 | import org.apache.cloudstack.utils.identity.ManagementServerNode; |
| 55 | +import org.apache.cloudstack.utils.reflectiontostringbuilderutils.ReflectionToStringBuilderUtils; |
55 | 56 | import org.apache.commons.lang3.BooleanUtils; |
56 | 57 | import org.apache.log4j.Logger; |
57 | 58 | import org.apache.log4j.MDC; |
@@ -569,27 +570,27 @@ protected AgentAttache notifyMonitorsOfConnection(final AgentAttache attache, fi |
569 | 570 | } |
570 | 571 | for (int i = 0; i < cmd.length; i++) { |
571 | 572 | try { |
| 573 | + if (s_logger.isDebugEnabled()) { |
| 574 | + s_logger.debug("process connection to issue " + ReflectionToStringBuilderUtils.reflectCollection(cmd[i]) + " forRebalance == " + forRebalance); |
| 575 | + } |
572 | 576 | monitor.second().processConnect(host, cmd[i], forRebalance); |
573 | | - } catch (final Exception e) { |
574 | | - if (e instanceof ConnectionException) { |
575 | | - final ConnectionException ce = (ConnectionException)e; |
576 | | - if (ce.isSetupError()) { |
577 | | - s_logger.warn("Monitor " + monitor.second().getClass().getSimpleName() + " says there is an error in the connect process for " + hostId + " due to " + e.getMessage()); |
578 | | - handleDisconnectWithoutInvestigation(attache, Event.AgentDisconnected, true, true); |
579 | | - throw ce; |
580 | | - } else { |
581 | | - s_logger.info("Monitor " + monitor.second().getClass().getSimpleName() + " says not to continue the connect process for " + hostId + " due to " + e.getMessage()); |
582 | | - handleDisconnectWithoutInvestigation(attache, Event.ShutdownRequested, true, true); |
583 | | - return attache; |
584 | | - } |
585 | | - } else if (e instanceof HypervisorVersionChangedException) { |
586 | | - handleDisconnectWithoutInvestigation(attache, Event.ShutdownRequested, true, true); |
587 | | - throw new CloudRuntimeException("Unable to connect " + attache.getId(), e); |
588 | | - } else { |
589 | | - s_logger.error("Monitor " + monitor.second().getClass().getSimpleName() + " says there is an error in the connect process for " + hostId + " due to " + e.getMessage(), e); |
| 577 | + } catch (final ConnectionException ce) { |
| 578 | + if (ce.isSetupError()) { |
| 579 | + s_logger.warn("Monitor " + monitor.second().getClass().getSimpleName() + " says there is an error in the connect process for " + hostId + " due to " + ce.getMessage()); |
590 | 580 | handleDisconnectWithoutInvestigation(attache, Event.AgentDisconnected, true, true); |
591 | | - throw new CloudRuntimeException("Unable to connect " + attache.getId(), e); |
| 581 | + throw ce; |
| 582 | + } else { |
| 583 | + s_logger.info("Monitor " + monitor.second().getClass().getSimpleName() + " says not to continue the connect process for " + hostId + " due to " + ce.getMessage()); |
| 584 | + handleDisconnectWithoutInvestigation(attache, Event.ShutdownRequested, true, true); |
| 585 | + return attache; |
592 | 586 | } |
| 587 | + } catch (final HypervisorVersionChangedException hvce) { |
| 588 | + handleDisconnectWithoutInvestigation(attache, Event.ShutdownRequested, true, true); |
| 589 | + throw new CloudRuntimeException("Unable to connect " + attache.getId(), hvce); |
| 590 | + } catch (final Exception e) { |
| 591 | + s_logger.error("Monitor " + monitor.second().getClass().getSimpleName() + " says there is an error in the connect process for " + hostId + " due to " + e.getMessage(), e); |
| 592 | + handleDisconnectWithoutInvestigation(attache, Event.AgentDisconnected, true, true); |
| 593 | + throw new CloudRuntimeException("Unable to connect " + attache.getId(), e); |
593 | 594 | } |
594 | 595 | } |
595 | 596 | } |
|
0 commit comments