You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "DaanHoogland (via GitHub)" <gi...@apache.org> on 2025/01/02 14:44:36 UTC
[PR] deal with NPE during host reconnect [cloudstack]
DaanHoogland opened a new pull request, #10158:
URL: https://github.com/apache/cloudstack/pull/10158
### Description
This PR is to investigate and solve #10154
log to see what command is being processed
<!--- Describe your changes in DETAIL - And how has behaviour functionally changed. -->
<!-- For new features, provide link to FS, dev ML discussion etc. -->
<!-- In case of bug fix, the expected and actual behaviours, steps to reproduce. -->
<!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be closed when this PR gets merged -->
<!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
Fixes: #10154
<!--- ******************************************************************************* -->
<!--- NOTE: AUTOMATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE DOCUMENTATION. -->
<!--- PLEASE PUT AN 'X' in only **ONE** box -->
<!--- ******************************************************************************* -->
### 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)
- [ ] Enhancement (improves an existing feature and functionality)
- [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
- [ ] build/CI
- [ ] test (unit or integration test code)
### Feature/Enhancement Scale or Bug Severity
#### Feature/Enhancement Scale
- [ ] Major
- [ ] Minor
#### Bug Severity
- [ ] BLOCKER
- [ ] Critical
- [ ] Major
- [ ] Minor
- [ ] Trivial
### Screenshots (if appropriate):
### How Has This Been Tested?
<!-- Please describe in detail how you tested your changes. -->
<!-- Include details of your testing environment, and the tests you ran to -->
#### How did you try to break this feature and the system with this change?
<!-- see how your change affects other areas of the code, etc. -->
<!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) document -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] deal with NPE during host reconnect [cloudstack]
Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on code in PR #10158:
URL: https://github.com/apache/cloudstack/pull/10158#discussion_r1928491645
##########
engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java:
##########
@@ -569,27 +570,27 @@ protected AgentAttache notifyMonitorsOfConnection(final AgentAttache attache, fi
}
for (int i = 0; i < cmd.length; i++) {
try {
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug("process connection to issue " + ReflectionToStringBuilderUtils.reflectCollection(cmd[i]) + " forRebalance == " + forRebalance);
+ }
monitor.second().processConnect(host, cmd[i], forRebalance);
- } catch (final Exception e) {
- if (e instanceof ConnectionException) {
- final ConnectionException ce = (ConnectionException)e;
- if (ce.isSetupError()) {
- s_logger.warn("Monitor " + monitor.second().getClass().getSimpleName() + " says there is an error in the connect process for " + hostId + " due to " + e.getMessage());
- handleDisconnectWithoutInvestigation(attache, Event.AgentDisconnected, true, true);
- throw ce;
- } else {
- s_logger.info("Monitor " + monitor.second().getClass().getSimpleName() + " says not to continue the connect process for " + hostId + " due to " + e.getMessage());
- handleDisconnectWithoutInvestigation(attache, Event.ShutdownRequested, true, true);
- return attache;
- }
- } else if (e instanceof HypervisorVersionChangedException) {
- handleDisconnectWithoutInvestigation(attache, Event.ShutdownRequested, true, true);
- throw new CloudRuntimeException("Unable to connect " + attache.getId(), e);
- } else {
- s_logger.error("Monitor " + monitor.second().getClass().getSimpleName() + " says there is an error in the connect process for " + hostId + " due to " + e.getMessage(), e);
+ } catch (final ConnectionException ce) {
+ if (ce.isSetupError()) {
+ s_logger.warn("Monitor " + monitor.second().getClass().getSimpleName() + " says there is an error in the connect process for " + hostId + " due to " + ce.getMessage());
handleDisconnectWithoutInvestigation(attache, Event.AgentDisconnected, true, true);
- throw new CloudRuntimeException("Unable to connect " + attache.getId(), e);
+ throw ce;
Review Comment:
ok. should we keep #10154 open ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] deal with NPE during host reconnect [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on code in PR #10158:
URL: https://github.com/apache/cloudstack/pull/10158#discussion_r1928463343
##########
engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java:
##########
@@ -569,27 +570,27 @@ protected AgentAttache notifyMonitorsOfConnection(final AgentAttache attache, fi
}
for (int i = 0; i < cmd.length; i++) {
try {
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug("process connection to issue " + ReflectionToStringBuilderUtils.reflectCollection(cmd[i]) + " forRebalance == " + forRebalance);
+ }
monitor.second().processConnect(host, cmd[i], forRebalance);
- } catch (final Exception e) {
- if (e instanceof ConnectionException) {
- final ConnectionException ce = (ConnectionException)e;
- if (ce.isSetupError()) {
- s_logger.warn("Monitor " + monitor.second().getClass().getSimpleName() + " says there is an error in the connect process for " + hostId + " due to " + e.getMessage());
- handleDisconnectWithoutInvestigation(attache, Event.AgentDisconnected, true, true);
- throw ce;
- } else {
- s_logger.info("Monitor " + monitor.second().getClass().getSimpleName() + " says not to continue the connect process for " + hostId + " due to " + e.getMessage());
- handleDisconnectWithoutInvestigation(attache, Event.ShutdownRequested, true, true);
- return attache;
- }
- } else if (e instanceof HypervisorVersionChangedException) {
- handleDisconnectWithoutInvestigation(attache, Event.ShutdownRequested, true, true);
- throw new CloudRuntimeException("Unable to connect " + attache.getId(), e);
- } else {
- s_logger.error("Monitor " + monitor.second().getClass().getSimpleName() + " says there is an error in the connect process for " + hostId + " due to " + e.getMessage(), e);
+ } catch (final ConnectionException ce) {
+ if (ce.isSetupError()) {
+ s_logger.warn("Monitor " + monitor.second().getClass().getSimpleName() + " says there is an error in the connect process for " + hostId + " due to " + ce.getMessage());
handleDisconnectWithoutInvestigation(attache, Event.AgentDisconnected, true, true);
- throw new CloudRuntimeException("Unable to connect " + attache.getId(), e);
+ throw ce;
Review Comment:
no, in the original also `ConnectionException` was thrown in this branch. (see lines 574 through 579 in the original)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] deal with NPE during host reconnect [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10158:
URL: https://github.com/apache/cloudstack/pull/10158#issuecomment-2582949099
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] deal with NPE during host reconnect [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10158:
URL: https://github.com/apache/cloudstack/pull/10158#issuecomment-2568023332
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11973
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] deal with NPE during host reconnect [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on code in PR #10158:
URL: https://github.com/apache/cloudstack/pull/10158#discussion_r1928463343
##########
engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java:
##########
@@ -569,27 +570,27 @@ protected AgentAttache notifyMonitorsOfConnection(final AgentAttache attache, fi
}
for (int i = 0; i < cmd.length; i++) {
try {
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug("process connection to issue " + ReflectionToStringBuilderUtils.reflectCollection(cmd[i]) + " forRebalance == " + forRebalance);
+ }
monitor.second().processConnect(host, cmd[i], forRebalance);
- } catch (final Exception e) {
- if (e instanceof ConnectionException) {
- final ConnectionException ce = (ConnectionException)e;
- if (ce.isSetupError()) {
- s_logger.warn("Monitor " + monitor.second().getClass().getSimpleName() + " says there is an error in the connect process for " + hostId + " due to " + e.getMessage());
- handleDisconnectWithoutInvestigation(attache, Event.AgentDisconnected, true, true);
- throw ce;
- } else {
- s_logger.info("Monitor " + monitor.second().getClass().getSimpleName() + " says not to continue the connect process for " + hostId + " due to " + e.getMessage());
- handleDisconnectWithoutInvestigation(attache, Event.ShutdownRequested, true, true);
- return attache;
- }
- } else if (e instanceof HypervisorVersionChangedException) {
- handleDisconnectWithoutInvestigation(attache, Event.ShutdownRequested, true, true);
- throw new CloudRuntimeException("Unable to connect " + attache.getId(), e);
- } else {
- s_logger.error("Monitor " + monitor.second().getClass().getSimpleName() + " says there is an error in the connect process for " + hostId + " due to " + e.getMessage(), e);
+ } catch (final ConnectionException ce) {
+ if (ce.isSetupError()) {
+ s_logger.warn("Monitor " + monitor.second().getClass().getSimpleName() + " says there is an error in the connect process for " + hostId + " due to " + ce.getMessage());
handleDisconnectWithoutInvestigation(attache, Event.AgentDisconnected, true, true);
- throw new CloudRuntimeException("Unable to connect " + attache.getId(), e);
+ throw ce;
Review Comment:
no, in the original also `ConnectionException` was thrown in this branch. (see line 579 in the original)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] deal with NPE during host reconnect [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #10158:
URL: https://github.com/apache/cloudstack/pull/10158#issuecomment-2582944448
@blueorangutan test
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] deal with NPE during host reconnect [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10158:
URL: https://github.com/apache/cloudstack/pull/10158#issuecomment-2567912273
Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 11972
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] deal with NPE during host reconnect [cloudstack]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #10158:
URL: https://github.com/apache/cloudstack/pull/10158#issuecomment-2567934529
## [Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/10158?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 4.30%. Comparing base [(`5c01cff`)](https://app.codecov.io/gh/apache/cloudstack/commit/5c01cff3043f9c1adee3b59a797702aa18ca26c8?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`321b329`)](https://app.codecov.io/gh/apache/cloudstack/commit/321b32902825b92c315b2d9f393e50dac76d15bb?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
> :exclamation: There is a different number of reports uploaded between BASE (5c01cff) and HEAD (321b329). Click for more details.
>
> <details><summary>HEAD has 1 upload less than BASE</summary>
>
>| Flag | BASE (5c01cff) | HEAD (321b329) |
>|------|------|------|
>|unittests|1|0|
></details>
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## 4.19 #10158 +/- ##
=============================================
- Coverage 15.12% 4.30% -10.83%
=============================================
Files 5408 366 -5042
Lines 473899 29570 -444329
Branches 57791 5180 -52611
=============================================
- Hits 71691 1272 -70419
+ Misses 394208 28154 -366054
+ Partials 8000 144 -7856
```
| [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/10158/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/10158/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `4.30% <ø> (ø)` | |
| [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/10158/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/cloudstack/pull/10158?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] deal with NPE during host reconnect [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10158:
URL: https://github.com/apache/cloudstack/pull/10158#issuecomment-2585082197
<b>[SF] Trillian test result (tid-12082)</b>
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 48409 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10158-t12082-kvm-ol8.zip
Smoke tests completed. 133 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:
Test | Result | Time (s) | Test File
--- | --- | --- | ---
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] deal with NPE during host reconnect [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10158:
URL: https://github.com/apache/cloudstack/pull/10158#issuecomment-2568954493
@rohityadavcloud [SL] I understand these words: "help", "hello", "thanks", "package", "test"
Test command usage: test [mgmt os] [hypervisor] [keepEnv] [qemuEv] [basicZone|securityGroups]
Mgmt OS options: ['ol8', 'ol9', 'debian12', 'rocky8', 'alma9', 'suse15', 'centos7', 'centos6', 'alma8', 'ubuntu18', 'ubuntu22', 'ubuntu20', 'ubuntu24']
Hypervisor options: ['kvm-centos6', 'kvm-centos7', 'kvm-rocky8', 'kvm-ol8', 'kvm-ol9', 'kvm-alma8', 'kvm-alma9', 'kvm-ubuntu18', 'kvm-ubuntu20', 'kvm-ubuntu22', 'kvm-ubuntu24', 'kvm-debian12', 'kvm-suse15', 'vmware-55u3', 'vmware-60u2', 'vmware-65u2', 'vmware-67u3', 'vmware-70u1', 'vmware-70u2', 'vmware-70u3', 'vmware-80', 'vmware-80u1', 'vmware-80u2', 'vmware-80u3', 'xenserver-65sp1', 'xenserver-71', 'xenserver-74', 'xcpng74', 'xcpng76', 'xcpng80', 'xcpng81', 'xcpng82']
Note: when keepEnv is passed, you need to specify mgmt server os and hypervisor or use the `matrix` command.
when qemuEv is passed, it will deploy KVM hyperviosr hosts with qemu-kvm-ev, else it will default to stock qemu.
When basicZone and/or securityGroups are passed it will create a zone of the last type specified (default is Advanced)
Package command usage: package [all(default value),kvm,xen,vmware,hyperv,ovm] - a comma separated list can be passed with package command to bundle the required hypervisor's systemVM templates. Not passing any argument will bundle all - kvm,xen and vmware templates.
Blessed contributors for kicking Trillian test jobs: ['rohityadavcloud', 'shwstppr', 'vishesh92', 'Pearl1594', 'harikrishna-patnala', 'nvazquez', 'DaanHoogland', 'weizhouapache', 'borisstoyanov', 'vladimirpetrov', 'kiranchavala', 'andrijapanicsb', 'NuxRo', 'rajujith', 'alexandremattioli', 'sureshanaparti', 'abh1sar']
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] deal with NPE during host reconnect [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #10158:
URL: https://github.com/apache/cloudstack/pull/10158#issuecomment-2567889677
@blueorangutan package
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] deal with NPE during host reconnect [cloudstack]
Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on code in PR #10158:
URL: https://github.com/apache/cloudstack/pull/10158#discussion_r1928448081
##########
engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java:
##########
@@ -569,27 +570,27 @@ protected AgentAttache notifyMonitorsOfConnection(final AgentAttache attache, fi
}
for (int i = 0; i < cmd.length; i++) {
try {
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug("process connection to issue " + ReflectionToStringBuilderUtils.reflectCollection(cmd[i]) + " forRebalance == " + forRebalance);
+ }
monitor.second().processConnect(host, cmd[i], forRebalance);
- } catch (final Exception e) {
- if (e instanceof ConnectionException) {
- final ConnectionException ce = (ConnectionException)e;
- if (ce.isSetupError()) {
- s_logger.warn("Monitor " + monitor.second().getClass().getSimpleName() + " says there is an error in the connect process for " + hostId + " due to " + e.getMessage());
- handleDisconnectWithoutInvestigation(attache, Event.AgentDisconnected, true, true);
- throw ce;
- } else {
- s_logger.info("Monitor " + monitor.second().getClass().getSimpleName() + " says not to continue the connect process for " + hostId + " due to " + e.getMessage());
- handleDisconnectWithoutInvestigation(attache, Event.ShutdownRequested, true, true);
- return attache;
- }
- } else if (e instanceof HypervisorVersionChangedException) {
- handleDisconnectWithoutInvestigation(attache, Event.ShutdownRequested, true, true);
- throw new CloudRuntimeException("Unable to connect " + attache.getId(), e);
- } else {
- s_logger.error("Monitor " + monitor.second().getClass().getSimpleName() + " says there is an error in the connect process for " + hostId + " due to " + e.getMessage(), e);
+ } catch (final ConnectionException ce) {
+ if (ce.isSetupError()) {
+ s_logger.warn("Monitor " + monitor.second().getClass().getSimpleName() + " says there is an error in the connect process for " + hostId + " due to " + ce.getMessage());
handleDisconnectWithoutInvestigation(attache, Event.AgentDisconnected, true, true);
- throw new CloudRuntimeException("Unable to connect " + attache.getId(), e);
+ throw ce;
Review Comment:
sorry for late comment.
this changes the exception from CloudRuntimeException to ConnectionException
is there any issue ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] deal with NPE during host reconnect [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on code in PR #10158:
URL: https://github.com/apache/cloudstack/pull/10158#discussion_r1928502052
##########
engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java:
##########
@@ -569,27 +570,27 @@ protected AgentAttache notifyMonitorsOfConnection(final AgentAttache attache, fi
}
for (int i = 0; i < cmd.length; i++) {
try {
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug("process connection to issue " + ReflectionToStringBuilderUtils.reflectCollection(cmd[i]) + " forRebalance == " + forRebalance);
+ }
monitor.second().processConnect(host, cmd[i], forRebalance);
- } catch (final Exception e) {
- if (e instanceof ConnectionException) {
- final ConnectionException ce = (ConnectionException)e;
- if (ce.isSetupError()) {
- s_logger.warn("Monitor " + monitor.second().getClass().getSimpleName() + " says there is an error in the connect process for " + hostId + " due to " + e.getMessage());
- handleDisconnectWithoutInvestigation(attache, Event.AgentDisconnected, true, true);
- throw ce;
- } else {
- s_logger.info("Monitor " + monitor.second().getClass().getSimpleName() + " says not to continue the connect process for " + hostId + " due to " + e.getMessage());
- handleDisconnectWithoutInvestigation(attache, Event.ShutdownRequested, true, true);
- return attache;
- }
- } else if (e instanceof HypervisorVersionChangedException) {
- handleDisconnectWithoutInvestigation(attache, Event.ShutdownRequested, true, true);
- throw new CloudRuntimeException("Unable to connect " + attache.getId(), e);
- } else {
- s_logger.error("Monitor " + monitor.second().getClass().getSimpleName() + " says there is an error in the connect process for " + hostId + " due to " + e.getMessage(), e);
+ } catch (final ConnectionException ce) {
+ if (ce.isSetupError()) {
+ s_logger.warn("Monitor " + monitor.second().getClass().getSimpleName() + " says there is an error in the connect process for " + hostId + " due to " + ce.getMessage());
handleDisconnectWithoutInvestigation(attache, Event.AgentDisconnected, true, true);
- throw new CloudRuntimeException("Unable to connect " + attache.getId(), e);
+ throw ce;
Review Comment:
I don't think it matters if we keep #10154 open or not @weizhouapache . The issue is not reproduced and I think we need a new issue if we get new information. We can always refer it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] deal with NPE during host reconnect [cloudstack]
Posted by "rohityadavcloud (via GitHub)" <gi...@apache.org>.
rohityadavcloud commented on PR #10158:
URL: https://github.com/apache/cloudstack/pull/10158#issuecomment-2568952326
@blueorangutan help
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] deal with NPE during host reconnect [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10158:
URL: https://github.com/apache/cloudstack/pull/10158#issuecomment-2567893138
@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. 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 to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] deal with NPE during host reconnect [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #10158:
URL: https://github.com/apache/cloudstack/pull/10158#issuecomment-2606985885
removed the needs tasting label as it proves not to be reproduced. Has been regression tested at least.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] deal with NPE during host reconnect [cloudstack]
Posted by "harikrishna-patnala (via GitHub)" <gi...@apache.org>.
harikrishna-patnala merged PR #10158:
URL: https://github.com/apache/cloudstack/pull/10158
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] deal with NPE during host reconnect [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on code in PR #10158:
URL: https://github.com/apache/cloudstack/pull/10158#discussion_r1928488410
##########
engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java:
##########
@@ -569,27 +570,27 @@ protected AgentAttache notifyMonitorsOfConnection(final AgentAttache attache, fi
}
for (int i = 0; i < cmd.length; i++) {
try {
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug("process connection to issue " + ReflectionToStringBuilderUtils.reflectCollection(cmd[i]) + " forRebalance == " + forRebalance);
+ }
monitor.second().processConnect(host, cmd[i], forRebalance);
- } catch (final Exception e) {
- if (e instanceof ConnectionException) {
- final ConnectionException ce = (ConnectionException)e;
- if (ce.isSetupError()) {
- s_logger.warn("Monitor " + monitor.second().getClass().getSimpleName() + " says there is an error in the connect process for " + hostId + " due to " + e.getMessage());
- handleDisconnectWithoutInvestigation(attache, Event.AgentDisconnected, true, true);
- throw ce;
- } else {
- s_logger.info("Monitor " + monitor.second().getClass().getSimpleName() + " says not to continue the connect process for " + hostId + " due to " + e.getMessage());
- handleDisconnectWithoutInvestigation(attache, Event.ShutdownRequested, true, true);
- return attache;
- }
- } else if (e instanceof HypervisorVersionChangedException) {
- handleDisconnectWithoutInvestigation(attache, Event.ShutdownRequested, true, true);
- throw new CloudRuntimeException("Unable to connect " + attache.getId(), e);
- } else {
- s_logger.error("Monitor " + monitor.second().getClass().getSimpleName() + " says there is an error in the connect process for " + hostId + " due to " + e.getMessage(), e);
+ } catch (final ConnectionException ce) {
+ if (ce.isSetupError()) {
+ s_logger.warn("Monitor " + monitor.second().getClass().getSimpleName() + " says there is an error in the connect process for " + hostId + " due to " + ce.getMessage());
handleDisconnectWithoutInvestigation(attache, Event.AgentDisconnected, true, true);
- throw new CloudRuntimeException("Unable to connect " + attache.getId(), e);
+ throw ce;
Review Comment:
I thought the original NPE must have been in
```
monitor.second().processConnect(host, cmd[i], forRebalance);
```
line 572 => 576
I have not reproduced it , but this code enhances the diagnostic value a bit.
If it was the `attache` the issue is still there , now in line 589 and 593, as it is not dereferenced in the fragments above. I'll add a PR to guard those lines as well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] deal with NPE during host reconnect [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on code in PR #10158:
URL: https://github.com/apache/cloudstack/pull/10158#discussion_r1928499104
##########
engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java:
##########
@@ -569,27 +570,27 @@ protected AgentAttache notifyMonitorsOfConnection(final AgentAttache attache, fi
}
for (int i = 0; i < cmd.length; i++) {
try {
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug("process connection to issue " + ReflectionToStringBuilderUtils.reflectCollection(cmd[i]) + " forRebalance == " + forRebalance);
+ }
monitor.second().processConnect(host, cmd[i], forRebalance);
- } catch (final Exception e) {
- if (e instanceof ConnectionException) {
- final ConnectionException ce = (ConnectionException)e;
- if (ce.isSetupError()) {
- s_logger.warn("Monitor " + monitor.second().getClass().getSimpleName() + " says there is an error in the connect process for " + hostId + " due to " + e.getMessage());
- handleDisconnectWithoutInvestigation(attache, Event.AgentDisconnected, true, true);
- throw ce;
- } else {
- s_logger.info("Monitor " + monitor.second().getClass().getSimpleName() + " says not to continue the connect process for " + hostId + " due to " + e.getMessage());
- handleDisconnectWithoutInvestigation(attache, Event.ShutdownRequested, true, true);
- return attache;
- }
- } else if (e instanceof HypervisorVersionChangedException) {
- handleDisconnectWithoutInvestigation(attache, Event.ShutdownRequested, true, true);
- throw new CloudRuntimeException("Unable to connect " + attache.getId(), e);
- } else {
- s_logger.error("Monitor " + monitor.second().getClass().getSimpleName() + " says there is an error in the connect process for " + hostId + " due to " + e.getMessage(), e);
+ } catch (final ConnectionException ce) {
+ if (ce.isSetupError()) {
+ s_logger.warn("Monitor " + monitor.second().getClass().getSimpleName() + " says there is an error in the connect process for " + hostId + " due to " + ce.getMessage());
handleDisconnectWithoutInvestigation(attache, Event.AgentDisconnected, true, true);
- throw new CloudRuntimeException("Unable to connect " + attache.getId(), e);
+ throw ce;
Review Comment:
added #10264 , thanks @weizhouapache
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] deal with NPE during host reconnect [cloudstack]
Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on code in PR #10158:
URL: https://github.com/apache/cloudstack/pull/10158#discussion_r1928470684
##########
engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java:
##########
@@ -569,27 +570,27 @@ protected AgentAttache notifyMonitorsOfConnection(final AgentAttache attache, fi
}
for (int i = 0; i < cmd.length; i++) {
try {
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug("process connection to issue " + ReflectionToStringBuilderUtils.reflectCollection(cmd[i]) + " forRebalance == " + forRebalance);
+ }
monitor.second().processConnect(host, cmd[i], forRebalance);
- } catch (final Exception e) {
- if (e instanceof ConnectionException) {
- final ConnectionException ce = (ConnectionException)e;
- if (ce.isSetupError()) {
- s_logger.warn("Monitor " + monitor.second().getClass().getSimpleName() + " says there is an error in the connect process for " + hostId + " due to " + e.getMessage());
- handleDisconnectWithoutInvestigation(attache, Event.AgentDisconnected, true, true);
- throw ce;
- } else {
- s_logger.info("Monitor " + monitor.second().getClass().getSimpleName() + " says not to continue the connect process for " + hostId + " due to " + e.getMessage());
- handleDisconnectWithoutInvestigation(attache, Event.ShutdownRequested, true, true);
- return attache;
- }
- } else if (e instanceof HypervisorVersionChangedException) {
- handleDisconnectWithoutInvestigation(attache, Event.ShutdownRequested, true, true);
- throw new CloudRuntimeException("Unable to connect " + attache.getId(), e);
- } else {
- s_logger.error("Monitor " + monitor.second().getClass().getSimpleName() + " says there is an error in the connect process for " + hostId + " due to " + e.getMessage(), e);
+ } catch (final ConnectionException ce) {
+ if (ce.isSetupError()) {
+ s_logger.warn("Monitor " + monitor.second().getClass().getSimpleName() + " says there is an error in the connect process for " + hostId + " due to " + ce.getMessage());
handleDisconnectWithoutInvestigation(attache, Event.AgentDisconnected, true, true);
- throw new CloudRuntimeException("Unable to connect " + attache.getId(), e);
+ throw ce;
Review Comment:
ah, ok, you are right.
so the original issue is line 591 (old count)
```
at com.cloud.agent.manager.AgentManagerImpl.notifyMonitorsOfConnection([AgentManagerImpl.java:591](http://agentmanagerimpl.java:591/))
```
now line 591 is moved to line 593 (new count)
```
throw new CloudRuntimeException("Unable to connect " + attache.getId(), e);
```
will the NPE issue still exist ? (I guess it was because attache is null ?)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org