cloudstack-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (CLOUDSTACK-8855) Improve Error Message for Host Alert State
Date Thu, 04 Jan 2018 15:26:00 GMT


ASF GitHub Bot commented on CLOUDSTACK-8855:

rafaelweingartner commented on a change in pull request #2380: CLOUDSTACK-8855 Improve Error
Message for Host Alert State and reconnect host API.

 File path: engine/orchestration/src/com/cloud/agent/manager/
 @@ -994,33 +994,28 @@ public Answer easySend(final Long hostId, final Command cmd) {
-    public boolean reconnect(final long hostId) {
+    public void reconnect(final long hostId) throws CloudRuntimeException, AgentUnavailableException{
         HostVO host;
         host = _hostDao.findById(hostId);
         if (host == null || host.getRemoved() != null) {
-            s_logger.warn("Unable to find host " + hostId);
-            return false;
+            throw new CloudRuntimeException("Unable to find host " + hostId);
         if (host.getStatus() == Status.Disconnected) {
-  "Host is already disconnected, no work to be done");
-            return true;
+            throw new CloudRuntimeException("Host is already disconnected, no work to be
 Review comment:
   I agree on this one. And besides that, if we take a closer look, the guy that proposed
this change, was replacing the return of boolean values with exceptions to indicate some error.
It makes sense that a false return would generate an exception while trying to reconnect as
the case at line 1002. This one was returning true, so it feels that we should not throw an
exception here.

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

> Improve Error Message for Host Alert State
> ------------------------------------------
>                 Key: CLOUDSTACK-8855
>                 URL:
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the default.) 
>    Affects Versions: 4.6.0
>            Reporter: Bharat Kumar
>            Assignee: Bharat Kumar

This message was sent by Atlassian JIRA

View raw message