Skip to content

Conversation

weizhouapache
Copy link
Member

Description

This PR fixes #11564

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?

How did you try to break this feature and the system with this change?

@weizhouapache weizhouapache added this to the 4.20.2 milestone Sep 4, 2025
@weizhouapache weizhouapache linked an issue Sep 4, 2025 that may be closed by this pull request
Copy link

codecov bot commented Sep 4, 2025

Codecov Report

❌ Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 16.17%. Comparing base (db5b6a5) to head (06b0504).

Files with missing lines Patch % Lines
...apache/cloudstack/vm/schedule/VMSchedulerImpl.java 0.00% 4 Missing ⚠️
...cloud/cluster/dao/ManagementServerHostDaoImpl.java 0.00% 1 Missing ⚠️
...che/cloudstack/mom/webhook/WebhookServiceImpl.java 0.00% 1 Missing ⚠️
.../cloud/resourcelimit/ResourceLimitManagerImpl.java 0.00% 1 Missing ⚠️
...loudstack/resource/ResourceCleanupServiceImpl.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               4.20   #11573   +/-   ##
=========================================
  Coverage     16.17%   16.17%           
+ Complexity    13286    13284    -2     
=========================================
  Files          5656     5656           
  Lines        498015   498019    +4     
  Branches      60406    60407    +1     
=========================================
+ Hits          80538    80539    +1     
- Misses       408515   408518    +3     
  Partials       8962     8962           
Flag Coverage Δ
uitests 4.00% <ø> (ø)
unittests 17.02% <0.00%> (+<0.01%) ⬆️

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.

Copy link
Contributor

@shwstppr shwstppr left a comment

Choose a reason for hiding this comment

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

looks good. One comment

@@ -190,6 +197,11 @@ public boolean start() {
final TimerTask schedulerPollTask = new ManagedContextTimerTask() {
@Override
protected void runInContext() {
ManagementServerHostVO msHost = managementServerHostDao.findOneInUpState(new Filter(ManagementServerHostVO.class, "id", false, 0L, 1L));
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a method named findOneByLongestRuntime(). Could that be used?

Copy link
Member Author

Choose a reason for hiding this comment

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

@shwstppr
yes, sure.
actually I considered both and decided to usefindOneInUpState as it is being used in more files

@shwstppr
Copy link
Contributor

shwstppr commented Sep 4, 2025

@blueorangutan package

@blueorangutan
Copy link

@shwstppr 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 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 14843

@weizhouapache
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@weizhouapache 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 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 14849

@@ -190,6 +196,11 @@ public boolean start() {
final TimerTask schedulerPollTask = new ManagedContextTimerTask() {
@Override
protected void runInContext() {
ManagementServerHostVO msHost = managementServerHostDao.findOneInUpStateByLongestRuntime();
Copy link
Member

@rohityadavcloud rohityadavcloud Sep 5, 2025

Choose a reason for hiding this comment

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

Should we require a GLOBAL_LOCK ? (I'm commenting here, but I don't know what's the best place to put it; generally global lock should wrap code which needs to run only at most in one mgmt ...)

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point

just checked the same file, there is a global lock in the poll method (line 225)

@shwstppr
Copy link
Contributor

shwstppr commented Sep 7, 2025

@blueorangutan test

@blueorangutan
Copy link

@shwstppr a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

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.

Recurrent insert errors in database on vm schedules
4 participants