[jira] [Commented] (CLOUDSTACK-10315) Inconsistent debugging info in catch block
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16429021#comment-16429021 ] ASF GitHub Bot commented on CLOUDSTACK-10315: - blueorangutan commented on issue #2547: CLOUDSTACK-10315 Inconsistent debugging info in catch block URL: https://github.com/apache/cloudstack/pull/2547#issuecomment-379383837 Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1883 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: us...@infra.apache.org > Inconsistent debugging info in catch block > -- > > Key: CLOUDSTACK-10315 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10315 > Project: CloudStack > Issue Type: Improvement > Security Level: Public(Anyone can view this level - this is the > default.) >Reporter: Zhenhao Li >Priority: Minor > Labels: easyfix > Attachments: image-2018-03-05-09-59-19-369.png, > image-2018-03-05-10-14-00-552.png, image-2018-03-05-10-14-25-802.png, > image-2018-03-26-17-45-44-489.png > > > We found that some logging statements have same log message, but one of them > has stack trace info, the other one of them doesn't have. Maybe a possible > reason is that they are code clone, developers changed one of them(add stack > trace info) but forgot to change the other one. Here's the details of those > logging statements we found: > > 1.*"Moving on to the next host because " + h.toString() + " is unavailable"*, > _com.cloud.hypervisor.ovm3.resources.Ovm3FenceBuilder.*fenceOff()*,_ > _com.cloud.ha.SimulatorFencer.*fenceOff()*_, > There are two identical log messages in these two places, the previous one > logged stack trace: > !image-2018-03-26-17-45-44-489.png! > But the latter one did not: > !image-2018-03-05-09-59-19-369.png! > We can see that they are in different type of catch block, but when checking > the logs they generated, maybe it's impossible to know the difference of them > without stack trace. So maybe the stack traces info should also be added here? > > 2.*"Network rule Conflict"* > _org.apache.cloudstack.api.command.user.firewall.CreatePortForwardingRuleCmd.*create()*,_ > _org.apache.cloudstack.api.command.user.firewall.CreateFirewallRuleCmd.*create()*_ > > The previous one has these two logging statements: > s_logger.info("Network rule conflict: ", ex); > s_logger.trace("Network Rule Conflict: ", ex); > > Comparing to the latter one which contains: > s_logger.info("Network rule conflict: " + ex.getMessage()); > s_logger.trace("Network Rule Conflict: ", ex); > Maybe it's better to have consistent exception handling here? > > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CLOUDSTACK-10315) Inconsistent debugging info in catch block
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16428952#comment-16428952 ] ASF GitHub Bot commented on CLOUDSTACK-10315: - blueorangutan commented on issue #2547: CLOUDSTACK-10315 Inconsistent debugging info in catch block URL: https://github.com/apache/cloudstack/pull/2547#issuecomment-379374045 @lzh3636 a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. 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: us...@infra.apache.org > Inconsistent debugging info in catch block > -- > > Key: CLOUDSTACK-10315 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10315 > Project: CloudStack > Issue Type: Improvement > Security Level: Public(Anyone can view this level - this is the > default.) >Reporter: Zhenhao Li >Priority: Minor > Labels: easyfix > Attachments: image-2018-03-05-09-59-19-369.png, > image-2018-03-05-10-14-00-552.png, image-2018-03-05-10-14-25-802.png, > image-2018-03-26-17-45-44-489.png > > > We found that some logging statements have same log message, but one of them > has stack trace info, the other one of them doesn't have. Maybe a possible > reason is that they are code clone, developers changed one of them(add stack > trace info) but forgot to change the other one. Here's the details of those > logging statements we found: > > 1.*"Moving on to the next host because " + h.toString() + " is unavailable"*, > _com.cloud.hypervisor.ovm3.resources.Ovm3FenceBuilder.*fenceOff()*,_ > _com.cloud.ha.SimulatorFencer.*fenceOff()*_, > There are two identical log messages in these two places, the previous one > logged stack trace: > !image-2018-03-26-17-45-44-489.png! > But the latter one did not: > !image-2018-03-05-09-59-19-369.png! > We can see that they are in different type of catch block, but when checking > the logs they generated, maybe it's impossible to know the difference of them > without stack trace. So maybe the stack traces info should also be added here? > > 2.*"Network rule Conflict"* > _org.apache.cloudstack.api.command.user.firewall.CreatePortForwardingRuleCmd.*create()*,_ > _org.apache.cloudstack.api.command.user.firewall.CreateFirewallRuleCmd.*create()*_ > > The previous one has these two logging statements: > s_logger.info("Network rule conflict: ", ex); > s_logger.trace("Network Rule Conflict: ", ex); > > Comparing to the latter one which contains: > s_logger.info("Network rule conflict: " + ex.getMessage()); > s_logger.trace("Network Rule Conflict: ", ex); > Maybe it's better to have consistent exception handling here? > > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CLOUDSTACK-10315) Inconsistent debugging info in catch block
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16428941#comment-16428941 ] ASF GitHub Bot commented on CLOUDSTACK-10315: - lzh3636 closed pull request #2547: CLOUDSTACK-10315 Inconsistent debugging info in catch block URL: https://github.com/apache/cloudstack/pull/2547 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/api/src/main/java/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java index ea0cb00301a..d4ea9a515a3 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java @@ -358,7 +358,7 @@ public void create() { setEntityId(result.getId()); setEntityUuid(result.getUuid()); } catch (NetworkRuleConflictException ex) { -s_logger.info("Network rule conflict: ", ex); +s_logger.info("Network rule conflict: " + ex.getMessage()); s_logger.trace("Network Rule Conflict: ", ex); throw new ServerApiException(ApiErrorCode.NETWORK_RULE_CONFLICT_ERROR, ex.getMessage()); } diff --git a/plugins/hypervisors/simulator/src/main/java/com/cloud/ha/SimulatorFencer.java b/plugins/hypervisors/simulator/src/main/java/com/cloud/ha/SimulatorFencer.java index 86c28715e0b..c776edfde35 100644 --- a/plugins/hypervisors/simulator/src/main/java/com/cloud/ha/SimulatorFencer.java +++ b/plugins/hypervisors/simulator/src/main/java/com/cloud/ha/SimulatorFencer.java @@ -90,12 +90,12 @@ public Boolean fenceOff(VirtualMachine vm, Host host) { answer = (FenceAnswer)_agentMgr.send(h.getId(), fence); } catch (AgentUnavailableException e) { if (s_logger.isDebugEnabled()) { -s_logger.debug("Moving on to the next host because " + h.toString() + " is unavailable"); +s_logger.debug("Moving on to the next host because " + h.toString() + " is unavailable", e); } continue; } catch (OperationTimedoutException e) { if (s_logger.isDebugEnabled()) { -s_logger.debug("Moving on to the next host because " + h.toString() + " is unavailable"); +s_logger.debug("Moving on to the next host because " + h.toString() + " is unavailable", e); } continue; } 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: us...@infra.apache.org > Inconsistent debugging info in catch block > -- > > Key: CLOUDSTACK-10315 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10315 > Project: CloudStack > Issue Type: Improvement > Security Level: Public(Anyone can view this level - this is the > default.) >Reporter: Zhenhao Li >Priority: Minor > Labels: easyfix > Attachments: image-2018-03-05-09-59-19-369.png, > image-2018-03-05-10-14-00-552.png, image-2018-03-05-10-14-25-802.png, > image-2018-03-26-17-45-44-489.png > > > We found that some logging statements have same log message, but one of them > has stack trace info, the other one of them doesn't have. Maybe a possible > reason is that they are code clone, developers changed one of them(add stack > trace info) but forgot to change the other one. Here's the details of those > logging statements we found: > > 1.*"Moving on to the next host because " + h.toString() + " is unavailable"*, > _com.cloud.hypervisor.ovm3.resources.Ovm3FenceBuilder.*fenceOff()*,_ > _com.cloud.ha.SimulatorFencer.*fenceOff()*_, > There are two identical log messages in these two places, the previous one > logged stack trace: > !image-2018-03-26-17-45-44-489.png! > But the latter one did not: > !image-2018-03-05-09-59-19-369.png! > We can see that they are in different type of catch block, but when checking > the logs they generated, maybe it's impossible to know the difference of them > without stack trace. So maybe the stack traces info should also be added here? > > 2.*"Network rule Conflict"* >
[jira] [Commented] (CLOUDSTACK-10315) Inconsistent debugging info in catch block
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16428926#comment-16428926 ] ASF GitHub Bot commented on CLOUDSTACK-10315: - blueorangutan commented on issue #2547: CLOUDSTACK-10315 Inconsistent debugging info in catch block URL: https://github.com/apache/cloudstack/pull/2547#issuecomment-379371139 Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1882 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: us...@infra.apache.org > Inconsistent debugging info in catch block > -- > > Key: CLOUDSTACK-10315 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10315 > Project: CloudStack > Issue Type: Improvement > Security Level: Public(Anyone can view this level - this is the > default.) >Reporter: Zhenhao Li >Priority: Minor > Labels: easyfix > Attachments: image-2018-03-05-09-59-19-369.png, > image-2018-03-05-10-14-00-552.png, image-2018-03-05-10-14-25-802.png, > image-2018-03-26-17-45-44-489.png > > > We found that some logging statements have same log message, but one of them > has stack trace info, the other one of them doesn't have. Maybe a possible > reason is that they are code clone, developers changed one of them(add stack > trace info) but forgot to change the other one. Here's the details of those > logging statements we found: > > 1.*"Moving on to the next host because " + h.toString() + " is unavailable"*, > _com.cloud.hypervisor.ovm3.resources.Ovm3FenceBuilder.*fenceOff()*,_ > _com.cloud.ha.SimulatorFencer.*fenceOff()*_, > There are two identical log messages in these two places, the previous one > logged stack trace: > !image-2018-03-26-17-45-44-489.png! > But the latter one did not: > !image-2018-03-05-09-59-19-369.png! > We can see that they are in different type of catch block, but when checking > the logs they generated, maybe it's impossible to know the difference of them > without stack trace. So maybe the stack traces info should also be added here? > > 2.*"Network rule Conflict"* > _org.apache.cloudstack.api.command.user.firewall.CreatePortForwardingRuleCmd.*create()*,_ > _org.apache.cloudstack.api.command.user.firewall.CreateFirewallRuleCmd.*create()*_ > > The previous one has these two logging statements: > s_logger.info("Network rule conflict: ", ex); > s_logger.trace("Network Rule Conflict: ", ex); > > Comparing to the latter one which contains: > s_logger.info("Network rule conflict: " + ex.getMessage()); > s_logger.trace("Network Rule Conflict: ", ex); > Maybe it's better to have consistent exception handling here? > > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CLOUDSTACK-10315) Inconsistent debugging info in catch block
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16428889#comment-16428889 ] ASF GitHub Bot commented on CLOUDSTACK-10315: - blueorangutan commented on issue #2547: CLOUDSTACK-10315 Inconsistent debugging info in catch block URL: https://github.com/apache/cloudstack/pull/2547#issuecomment-379365051 @lzh3636 a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. 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: us...@infra.apache.org > Inconsistent debugging info in catch block > -- > > Key: CLOUDSTACK-10315 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10315 > Project: CloudStack > Issue Type: Improvement > Security Level: Public(Anyone can view this level - this is the > default.) >Reporter: Zhenhao Li >Priority: Minor > Labels: easyfix > Attachments: image-2018-03-05-09-59-19-369.png, > image-2018-03-05-10-14-00-552.png, image-2018-03-05-10-14-25-802.png, > image-2018-03-26-17-45-44-489.png > > > We found that some logging statements have same log message, but one of them > has stack trace info, the other one of them doesn't have. Maybe a possible > reason is that they are code clone, developers changed one of them(add stack > trace info) but forgot to change the other one. Here's the details of those > logging statements we found: > > 1.*"Moving on to the next host because " + h.toString() + " is unavailable"*, > _com.cloud.hypervisor.ovm3.resources.Ovm3FenceBuilder.*fenceOff()*,_ > _com.cloud.ha.SimulatorFencer.*fenceOff()*_, > There are two identical log messages in these two places, the previous one > logged stack trace: > !image-2018-03-26-17-45-44-489.png! > But the latter one did not: > !image-2018-03-05-09-59-19-369.png! > We can see that they are in different type of catch block, but when checking > the logs they generated, maybe it's impossible to know the difference of them > without stack trace. So maybe the stack traces info should also be added here? > > 2.*"Network rule Conflict"* > _org.apache.cloudstack.api.command.user.firewall.CreatePortForwardingRuleCmd.*create()*,_ > _org.apache.cloudstack.api.command.user.firewall.CreateFirewallRuleCmd.*create()*_ > > The previous one has these two logging statements: > s_logger.info("Network rule conflict: ", ex); > s_logger.trace("Network Rule Conflict: ", ex); > > Comparing to the latter one which contains: > s_logger.info("Network rule conflict: " + ex.getMessage()); > s_logger.trace("Network Rule Conflict: ", ex); > Maybe it's better to have consistent exception handling here? > > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CLOUDSTACK-10315) Inconsistent debugging info in catch block
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=1642#comment-1642 ] ASF GitHub Bot commented on CLOUDSTACK-10315: - lzh3636 opened a new pull request #2547: CLOUDSTACK-10315 Inconsistent debugging info in catch block URL: https://github.com/apache/cloudstack/pull/2547 ## Description The description of the problem: https://issues.apache.org/jira/browse/CLOUDSTACK-10315 I modified some stack traces information to those logging statements with the same log messages, make their stack trace consistent. ## Types of changes - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] New feature (non-breaking change which adds functionality) - [ ] Bug fix (non-breaking change which fixes an issue) - [x] Enhancement (improves an existing feature and functionality) - [ ] Cleanup (Code refactoring and cleanup, that may add test cases) ## Checklist: - [x] I have read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/master/CONTRIBUTING.md) document. - [x] My code follows the code style of this project. - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. Testing - [ ] I have added tests to cover my changes. - [ ] All relevant new and existing integration tests have passed. - [x] A full integration testsuite with all test that can run on my environment has passed. @blueorangutan package 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: us...@infra.apache.org > Inconsistent debugging info in catch block > -- > > Key: CLOUDSTACK-10315 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10315 > Project: CloudStack > Issue Type: Improvement > Security Level: Public(Anyone can view this level - this is the > default.) >Reporter: Zhenhao Li >Priority: Minor > Labels: easyfix > Attachments: image-2018-03-05-09-59-19-369.png, > image-2018-03-05-10-14-00-552.png, image-2018-03-05-10-14-25-802.png, > image-2018-03-26-17-45-44-489.png > > > We found that some logging statements have same log message, but one of them > has stack trace info, the other one of them doesn't have. Maybe a possible > reason is that they are code clone, developers changed one of them(add stack > trace info) but forgot to change the other one. Here's the details of those > logging statements we found: > > 1.*"Moving on to the next host because " + h.toString() + " is unavailable"*, > _com.cloud.hypervisor.ovm3.resources.Ovm3FenceBuilder.*fenceOff()*,_ > _com.cloud.ha.SimulatorFencer.*fenceOff()*_, > There are two identical log messages in these two places, the previous one > logged stack trace: > !image-2018-03-26-17-45-44-489.png! > But the latter one did not: > !image-2018-03-05-09-59-19-369.png! > We can see that they are in different type of catch block, but when checking > the logs they generated, maybe it's impossible to know the difference of them > without stack trace. So maybe the stack traces info should also be added here? > > 2.*"Network rule Conflict"* > _org.apache.cloudstack.api.command.user.firewall.CreatePortForwardingRuleCmd.*create()*,_ > _org.apache.cloudstack.api.command.user.firewall.CreateFirewallRuleCmd.*create()*_ > > The previous one has these two logging statements: > s_logger.info("Network rule conflict: ", ex); > s_logger.trace("Network Rule Conflict: ", ex); > > Comparing to the latter one which contains: > s_logger.info("Network rule conflict: " + ex.getMessage()); > s_logger.trace("Network Rule Conflict: ", ex); > Maybe it's better to have consistent exception handling here? > > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CLOUDSTACK-10315) Inconsistent debugging info in catch block
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16428804#comment-16428804 ] ASF GitHub Bot commented on CLOUDSTACK-10315: - blueorangutan commented on issue #2547: CLOUDSTACK-10315 Inconsistent debugging info in catch block URL: https://github.com/apache/cloudstack/pull/2547#issuecomment-379348907 Packaging result: ✔centos6 ✔centos7 ✖debian. JID-1881 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: us...@infra.apache.org > Inconsistent debugging info in catch block > -- > > Key: CLOUDSTACK-10315 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10315 > Project: CloudStack > Issue Type: Improvement > Security Level: Public(Anyone can view this level - this is the > default.) >Reporter: Zhenhao Li >Priority: Minor > Labels: easyfix > Attachments: image-2018-03-05-09-59-19-369.png, > image-2018-03-05-10-14-00-552.png, image-2018-03-05-10-14-25-802.png, > image-2018-03-26-17-45-44-489.png > > > We found that some logging statements have same log message, but one of them > has stack trace info, the other one of them doesn't have. Maybe a possible > reason is that they are code clone, developers changed one of them(add stack > trace info) but forgot to change the other one. Here's the details of those > logging statements we found: > > 1.*"Moving on to the next host because " + h.toString() + " is unavailable"*, > _com.cloud.hypervisor.ovm3.resources.Ovm3FenceBuilder.*fenceOff()*,_ > _com.cloud.ha.SimulatorFencer.*fenceOff()*_, > There are two identical log messages in these two places, the previous one > logged stack trace: > !image-2018-03-26-17-45-44-489.png! > But the latter one did not: > !image-2018-03-05-09-59-19-369.png! > We can see that they are in different type of catch block, but when checking > the logs they generated, maybe it's impossible to know the difference of them > without stack trace. So maybe the stack traces info should also be added here? > > 2.*"Network rule Conflict"* > _org.apache.cloudstack.api.command.user.firewall.CreatePortForwardingRuleCmd.*create()*,_ > _org.apache.cloudstack.api.command.user.firewall.CreateFirewallRuleCmd.*create()*_ > > The previous one has these two logging statements: > s_logger.info("Network rule conflict: ", ex); > s_logger.trace("Network Rule Conflict: ", ex); > > Comparing to the latter one which contains: > s_logger.info("Network rule conflict: " + ex.getMessage()); > s_logger.trace("Network Rule Conflict: ", ex); > Maybe it's better to have consistent exception handling here? > > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CLOUDSTACK-10315) Inconsistent debugging info in catch block
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16428793#comment-16428793 ] ASF GitHub Bot commented on CLOUDSTACK-10315: - lzh3636 closed pull request #2547: CLOUDSTACK-10315 Inconsistent debugging info in catch block URL: https://github.com/apache/cloudstack/pull/2547 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/api/src/main/java/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java index ea0cb00301a..4aa7441505c 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java @@ -358,7 +358,7 @@ public void create() { setEntityId(result.getId()); setEntityUuid(result.getUuid()); } catch (NetworkRuleConflictException ex) { -s_logger.info("Network rule conflict: ", ex); +s_logger.info("Network rule conflict: ", ex.getMessage()); s_logger.trace("Network Rule Conflict: ", ex); throw new ServerApiException(ApiErrorCode.NETWORK_RULE_CONFLICT_ERROR, ex.getMessage()); } diff --git a/plugins/hypervisors/simulator/src/main/java/com/cloud/ha/SimulatorFencer.java b/plugins/hypervisors/simulator/src/main/java/com/cloud/ha/SimulatorFencer.java index 86c28715e0b..c776edfde35 100644 --- a/plugins/hypervisors/simulator/src/main/java/com/cloud/ha/SimulatorFencer.java +++ b/plugins/hypervisors/simulator/src/main/java/com/cloud/ha/SimulatorFencer.java @@ -90,12 +90,12 @@ public Boolean fenceOff(VirtualMachine vm, Host host) { answer = (FenceAnswer)_agentMgr.send(h.getId(), fence); } catch (AgentUnavailableException e) { if (s_logger.isDebugEnabled()) { -s_logger.debug("Moving on to the next host because " + h.toString() + " is unavailable"); +s_logger.debug("Moving on to the next host because " + h.toString() + " is unavailable", e); } continue; } catch (OperationTimedoutException e) { if (s_logger.isDebugEnabled()) { -s_logger.debug("Moving on to the next host because " + h.toString() + " is unavailable"); +s_logger.debug("Moving on to the next host because " + h.toString() + " is unavailable", e); } continue; } 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: us...@infra.apache.org > Inconsistent debugging info in catch block > -- > > Key: CLOUDSTACK-10315 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10315 > Project: CloudStack > Issue Type: Improvement > Security Level: Public(Anyone can view this level - this is the > default.) >Reporter: Zhenhao Li >Priority: Minor > Labels: easyfix > Attachments: image-2018-03-05-09-59-19-369.png, > image-2018-03-05-10-14-00-552.png, image-2018-03-05-10-14-25-802.png, > image-2018-03-26-17-45-44-489.png > > > We found that some logging statements have same log message, but one of them > has stack trace info, the other one of them doesn't have. Maybe a possible > reason is that they are code clone, developers changed one of them(add stack > trace info) but forgot to change the other one. Here's the details of those > logging statements we found: > > 1.*"Moving on to the next host because " + h.toString() + " is unavailable"*, > _com.cloud.hypervisor.ovm3.resources.Ovm3FenceBuilder.*fenceOff()*,_ > _com.cloud.ha.SimulatorFencer.*fenceOff()*_, > There are two identical log messages in these two places, the previous one > logged stack trace: > !image-2018-03-26-17-45-44-489.png! > But the latter one did not: > !image-2018-03-05-09-59-19-369.png! > We can see that they are in different type of catch block, but when checking > the logs they generated, maybe it's impossible to know the difference of them > without stack trace. So maybe the stack traces info should also be added here? > > 2.*"Network rule Conflict"* >
[jira] [Commented] (CLOUDSTACK-10315) Inconsistent debugging info in catch block
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16428794#comment-16428794 ] ASF GitHub Bot commented on CLOUDSTACK-10315: - blueorangutan commented on issue #2547: CLOUDSTACK-10315 Inconsistent debugging info in catch block URL: https://github.com/apache/cloudstack/pull/2547#issuecomment-379345899 @lzh3636 a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. 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: us...@infra.apache.org > Inconsistent debugging info in catch block > -- > > Key: CLOUDSTACK-10315 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10315 > Project: CloudStack > Issue Type: Improvement > Security Level: Public(Anyone can view this level - this is the > default.) >Reporter: Zhenhao Li >Priority: Minor > Labels: easyfix > Attachments: image-2018-03-05-09-59-19-369.png, > image-2018-03-05-10-14-00-552.png, image-2018-03-05-10-14-25-802.png, > image-2018-03-26-17-45-44-489.png > > > We found that some logging statements have same log message, but one of them > has stack trace info, the other one of them doesn't have. Maybe a possible > reason is that they are code clone, developers changed one of them(add stack > trace info) but forgot to change the other one. Here's the details of those > logging statements we found: > > 1.*"Moving on to the next host because " + h.toString() + " is unavailable"*, > _com.cloud.hypervisor.ovm3.resources.Ovm3FenceBuilder.*fenceOff()*,_ > _com.cloud.ha.SimulatorFencer.*fenceOff()*_, > There are two identical log messages in these two places, the previous one > logged stack trace: > !image-2018-03-26-17-45-44-489.png! > But the latter one did not: > !image-2018-03-05-09-59-19-369.png! > We can see that they are in different type of catch block, but when checking > the logs they generated, maybe it's impossible to know the difference of them > without stack trace. So maybe the stack traces info should also be added here? > > 2.*"Network rule Conflict"* > _org.apache.cloudstack.api.command.user.firewall.CreatePortForwardingRuleCmd.*create()*,_ > _org.apache.cloudstack.api.command.user.firewall.CreateFirewallRuleCmd.*create()*_ > > The previous one has these two logging statements: > s_logger.info("Network rule conflict: ", ex); > s_logger.trace("Network Rule Conflict: ", ex); > > Comparing to the latter one which contains: > s_logger.info("Network rule conflict: " + ex.getMessage()); > s_logger.trace("Network Rule Conflict: ", ex); > Maybe it's better to have consistent exception handling here? > > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CLOUDSTACK-10315) Inconsistent debugging info in catch block
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16428776#comment-16428776 ] ASF GitHub Bot commented on CLOUDSTACK-10315: - blueorangutan commented on issue #2547: CLOUDSTACK-10315 Inconsistent debugging info in catch block URL: https://github.com/apache/cloudstack/pull/2547#issuecomment-379343876 Packaging result: ✔centos6 ✔centos7 ✖debian. JID-1880 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: us...@infra.apache.org > Inconsistent debugging info in catch block > -- > > Key: CLOUDSTACK-10315 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10315 > Project: CloudStack > Issue Type: Improvement > Security Level: Public(Anyone can view this level - this is the > default.) >Reporter: Zhenhao Li >Priority: Minor > Labels: easyfix > Attachments: image-2018-03-05-09-59-19-369.png, > image-2018-03-05-10-14-00-552.png, image-2018-03-05-10-14-25-802.png, > image-2018-03-26-17-45-44-489.png > > > We found that some logging statements have same log message, but one of them > has stack trace info, the other one of them doesn't have. Maybe a possible > reason is that they are code clone, developers changed one of them(add stack > trace info) but forgot to change the other one. Here's the details of those > logging statements we found: > > 1.*"Moving on to the next host because " + h.toString() + " is unavailable"*, > _com.cloud.hypervisor.ovm3.resources.Ovm3FenceBuilder.*fenceOff()*,_ > _com.cloud.ha.SimulatorFencer.*fenceOff()*_, > There are two identical log messages in these two places, the previous one > logged stack trace: > !image-2018-03-26-17-45-44-489.png! > But the latter one did not: > !image-2018-03-05-09-59-19-369.png! > We can see that they are in different type of catch block, but when checking > the logs they generated, maybe it's impossible to know the difference of them > without stack trace. So maybe the stack traces info should also be added here? > > 2.*"Network rule Conflict"* > _org.apache.cloudstack.api.command.user.firewall.CreatePortForwardingRuleCmd.*create()*,_ > _org.apache.cloudstack.api.command.user.firewall.CreateFirewallRuleCmd.*create()*_ > > The previous one has these two logging statements: > s_logger.info("Network rule conflict: ", ex); > s_logger.trace("Network Rule Conflict: ", ex); > > Comparing to the latter one which contains: > s_logger.info("Network rule conflict: " + ex.getMessage()); > s_logger.trace("Network Rule Conflict: ", ex); > Maybe it's better to have consistent exception handling here? > > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CLOUDSTACK-10315) Inconsistent debugging info in catch block
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16428753#comment-16428753 ] ASF GitHub Bot commented on CLOUDSTACK-10315: - blueorangutan commented on issue #2547: CLOUDSTACK-10315 Inconsistent debugging info in catch block URL: https://github.com/apache/cloudstack/pull/2547#issuecomment-379340358 @lzh3636 a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. 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: us...@infra.apache.org > Inconsistent debugging info in catch block > -- > > Key: CLOUDSTACK-10315 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10315 > Project: CloudStack > Issue Type: Improvement > Security Level: Public(Anyone can view this level - this is the > default.) >Reporter: Zhenhao Li >Priority: Minor > Labels: easyfix > Attachments: image-2018-03-05-09-59-19-369.png, > image-2018-03-05-10-14-00-552.png, image-2018-03-05-10-14-25-802.png, > image-2018-03-26-17-45-44-489.png > > > We found that some logging statements have same log message, but one of them > has stack trace info, the other one of them doesn't have. Maybe a possible > reason is that they are code clone, developers changed one of them(add stack > trace info) but forgot to change the other one. Here's the details of those > logging statements we found: > > 1.*"Moving on to the next host because " + h.toString() + " is unavailable"*, > _com.cloud.hypervisor.ovm3.resources.Ovm3FenceBuilder.*fenceOff()*,_ > _com.cloud.ha.SimulatorFencer.*fenceOff()*_, > There are two identical log messages in these two places, the previous one > logged stack trace: > !image-2018-03-26-17-45-44-489.png! > But the latter one did not: > !image-2018-03-05-09-59-19-369.png! > We can see that they are in different type of catch block, but when checking > the logs they generated, maybe it's impossible to know the difference of them > without stack trace. So maybe the stack traces info should also be added here? > > 2.*"Network rule Conflict"* > _org.apache.cloudstack.api.command.user.firewall.CreatePortForwardingRuleCmd.*create()*,_ > _org.apache.cloudstack.api.command.user.firewall.CreateFirewallRuleCmd.*create()*_ > > The previous one has these two logging statements: > s_logger.info("Network rule conflict: ", ex); > s_logger.trace("Network Rule Conflict: ", ex); > > Comparing to the latter one which contains: > s_logger.info("Network rule conflict: " + ex.getMessage()); > s_logger.trace("Network Rule Conflict: ", ex); > Maybe it's better to have consistent exception handling here? > > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (CLOUDSTACK-10315) Inconsistent debugging info in catch block
[ https://issues.apache.org/jira/browse/CLOUDSTACK-10315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16428751#comment-16428751 ] ASF GitHub Bot commented on CLOUDSTACK-10315: - lzh3636 opened a new pull request #2547: CLOUDSTACK-10315 Inconsistent debugging info in catch block URL: https://github.com/apache/cloudstack/pull/2547 ## Description The description of the problem: https://issues.apache.org/jira/browse/CLOUDSTACK-10315 I modified some stack traces information to those logging statements with the same log messages, make their stack trace consistent. ## Types of changes - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] New feature (non-breaking change which adds functionality) - [ ] Bug fix (non-breaking change which fixes an issue) - [x] Enhancement (improves an existing feature and functionality) - [ ] Cleanup (Code refactoring and cleanup, that may add test cases) ## Screenshots (if appropriate): ## How Has This Been Tested? ## Checklist: - [x] I have read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/master/CONTRIBUTING.md) document. - [x] My code follows the code style of this project. - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. Testing - [ ] I have added tests to cover my changes. - [ ] All relevant new and existing integration tests have passed. - [x] A full integration testsuite with all test that can run on my environment has passed. @blueorangutan package 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: us...@infra.apache.org > Inconsistent debugging info in catch block > -- > > Key: CLOUDSTACK-10315 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10315 > Project: CloudStack > Issue Type: Improvement > Security Level: Public(Anyone can view this level - this is the > default.) >Reporter: Zhenhao Li >Priority: Minor > Labels: easyfix > Attachments: image-2018-03-05-09-59-19-369.png, > image-2018-03-05-10-14-00-552.png, image-2018-03-05-10-14-25-802.png, > image-2018-03-26-17-45-44-489.png > > > We found that some logging statements have same log message, but one of them > has stack trace info, the other one of them doesn't have. Maybe a possible > reason is that they are code clone, developers changed one of them(add stack > trace info) but forgot to change the other one. Here's the details of those > logging statements we found: > > 1.*"Moving on to the next host because " + h.toString() + " is unavailable"*, > _com.cloud.hypervisor.ovm3.resources.Ovm3FenceBuilder.*fenceOff()*,_ > _com.cloud.ha.SimulatorFencer.*fenceOff()*_, > There are two identical log messages in these two places, the previous one > logged stack trace: > !image-2018-03-26-17-45-44-489.png! > But the latter one did not: > !image-2018-03-05-09-59-19-369.png! > We can see that they are in different type of catch block, but when checking > the logs they generated, maybe it's impossible to know the difference of them > without stack trace. So maybe the stack traces info should also be added here? > > 2.*"Network rule Conflict"* > _org.apache.cloudstack.api.command.user.firewall.CreatePortForwardingRuleCmd.*create()*,_ > _org.apache.cloudstack.api.command.user.firewall.CreateFirewallRuleCmd.*create()*_ > > The previous one has these two logging statements: > s_logger.info("Network rule conflict: ", ex); > s_logger.trace("Network Rule Conflict: ", ex); > > Comparing to the latter one which contains: > s_logger.info("Network rule conflict: " + ex.getMessage()); > s_logger.trace("Network Rule Conflict: ", ex); > Maybe it's better to have consistent exception handling here? > > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)