Skip to content

Conversation

@sureshanaparti
Copy link
Contributor

@sureshanaparti sureshanaparti commented Jul 29, 2025

Description

This PR shutdowns MS maintenance jobs when finished.

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?

@sureshanaparti
Copy link
Contributor Author

@blueorangutan package

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a resource leak issue by properly shutting down MS maintenance jobs when they are finished. The main purpose is to ensure that scheduled executor services are properly terminated to prevent memory leaks.

  • Added cancelWaitForPendingJobs() calls in error scenarios where the management server cannot be found
  • Properly shutdown the scheduled executor service after scheduling migration tasks

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
ManagementServerMaintenanceManagerImpl.java Added cleanup calls to cancel pending jobs when management server lookup fails
Agent.java Fixed executor service resource leak by properly shutting down the migration agent connection service

@codecov
Copy link

codecov bot commented Jul 29, 2025

Codecov Report

❌ Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.16%. Comparing base (217ff27) to head (be82b20).
⚠️ Report is 59 commits behind head on main.

Files with missing lines Patch % Lines
agent/src/main/java/com/cloud/agent/Agent.java 0.00% 3 Missing ⚠️
...enance/ManagementServerMaintenanceManagerImpl.java 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #11330      +/-   ##
============================================
+ Coverage     16.76%   17.16%   +0.40%     
- Complexity    14281    14982     +701     
============================================
  Files          5767     5869     +102     
  Lines        512657   521595    +8938     
  Branches      62359    63485    +1126     
============================================
+ Hits          85941    89552    +3611     
- Misses       417118   421977    +4859     
- Partials       9598    10066     +468     
Flag Coverage Δ
uitests 3.75% <ø> (-0.11%) ⬇️
unittests 18.14% <0.00%> (+0.46%) ⬆️

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.

@sureshanaparti
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@sureshanaparti 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
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

@blueorangutan
Copy link

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

@sureshanaparti
Copy link
Contributor Author

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

[SF] Trillian test result (tid-13964)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 56491 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11330-t13964-kvm-ol8.zip
Smoke tests completed. 144 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_deployVMInSharedNetwork Failure 462.82 test_network.py

Copy link
Contributor

@harikrishna-patnala harikrishna-patnala left a comment

Choose a reason for hiding this comment

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

LGTM

@sureshanaparti sureshanaparti marked this pull request as ready for review July 30, 2025 09:29
@sureshanaparti sureshanaparti merged commit 7124922 into apache:main Jul 31, 2025
22 of 25 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Apache CloudStack 4.21.0 Jul 31, 2025
@sureshanaparti sureshanaparti deleted the shutdown-ms-maintenance-jobs branch July 31, 2025 04:39
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants