Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

framework/cluster: fix NPE for ms-host status when mgr stops #10500

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rohityadavcloud
Copy link
Member

This handles an NPE case for when management server host status is not found in the DB, when stopping the cluster manager.

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?

On Mac OS, the stat collector doesn't run well as the code assumes to be running on Linux. On non-Linux env, this is easily reproducible.

This handles an NPE case for when management server host status is not
found in the DB, when stopping the cluster manager.

Signed-off-by: Rohit Yadav <[email protected]>
@rohityadavcloud rohityadavcloud added this to the 4.21.0 milestone Mar 5, 2025
@rohityadavcloud
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@rohityadavcloud 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.

Copy link

codecov bot commented Mar 5, 2025

Codecov Report

Attention: Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.

Project coverage is 16.17%. Comparing base (eab37ec) to head (ddd0f99).
Report is 19 commits behind head on main.

Files with missing lines Patch % Lines
...ain/java/com/cloud/cluster/ClusterManagerImpl.java 0.00% 11 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #10500      +/-   ##
============================================
+ Coverage     16.15%   16.17%   +0.01%     
- Complexity    13274    13292      +18     
============================================
  Files          5666     5668       +2     
  Lines        498078   498187     +109     
  Branches      60267    60291      +24     
============================================
+ Hits          80481    80592     +111     
+ Misses       408584   408572      -12     
- Partials       9013     9023      +10     
Flag Coverage Δ
uitests 3.99% <ø> (-0.01%) ⬇️
unittests 17.02% <0.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@blueorangutan
Copy link

Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 12659

@rohityadavcloud
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@rohityadavcloud 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.

Copy link
Member

@weizhouapache weizhouapache left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code lgtm

@weizhouapache
Copy link
Member

it looks this issue exists for some years

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12661

Copy link
Collaborator

@bernardodemarco bernardodemarco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

@bernardodemarco
Copy link
Collaborator

@rohityadavcloud, I think we should also address this fix on 4.20:

if (_mshostId != null) {
final ManagementServerHostVO mshost = _mshostDao.findByMsid(_msId);
final ManagementServerStatusVO mshostStatus = mshostStatusDao.findByMsId(mshost.getUuid());
mshost.setState(ManagementServerHost.State.Down);
mshostStatus.setLastJvmStop(new Date());
_mshostDao.update(_mshostId, mshost);
mshostStatusDao.update(mshostStatus.getId(), mshostStatus);
}

What do you think?

@rohityadavcloud
Copy link
Member Author

rohityadavcloud commented Mar 5, 2025

@bernardodemarco yes, I didn't send it on 4.20 branch as I reckon this affects devs (on non-Linux env) more than production users on Linux. But feel free to send a PR.

@bernardodemarco
Copy link
Collaborator

@bernardodemarco yes, I didn't send it on 4.20 branch as I reckon this affects devs (on non-Linux env) more than production users on Linux. But feel free to send a PR.

Ok, got it. So, after this one gets merged, I'll backport it to the 4.20 branch in a new PR

@rohityadavcloud
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@rohityadavcloud 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.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12693

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants