Skip to content

plugins/shutdown: fix triggerShutdown scheduling and response#9276

Merged
sureshanaparti merged 1 commit into
apache:4.19from
shapeblue:fix-trigger-shutdown
Jun 21, 2024
Merged

plugins/shutdown: fix triggerShutdown scheduling and response#9276
sureshanaparti merged 1 commit into
apache:4.19from
shapeblue:fix-trigger-shutdown

Conversation

@shwstppr
Copy link
Copy Markdown
Contributor

@shwstppr shwstppr commented Jun 20, 2024

Description

Earlier the triggerShutdown API would immediately shutdown the MS and if it is the same MS on which API is called and there are no pending jobs it would lead to error in the API call. This change adds a delay to the process so the MS would be able to send response to the API.

This should fix test failure seen in PR wrt test_safe_shutdown.py,
https://github.com/apache/cloudstack/pull/8601#issuecomment-2177437854https://github.com/apache/cloudstack/pull/8601#issuecomment-2177479552

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?

Without fix:

localcloud) 🐱 > trigger shutdown managementserverid=1
🙈 Error: Get "http://1.2.3.4:8080/client/api?apiKey=LIN6rqXuaJwMPfGYFh13qDwYz5VNNz1J2J6qIOWcd3oLQOq0WtD4CwRundBL6rzXToa3lQOC_vKjI3nkHtiD8Q&command=triggerShutdown&managementserverid=1&response=json&signature=7PpZ8vp4jKIbTe41HqhNwfjVp4g%3D": dial tcp 1.2.3.4:8080: connect: connection refused

After fix:

(local) 🐱 > trigger shutdown managementserverid=1
{
  "triggershutdown": {
    "managementserverid": 1,
    "pendingjobscount": 0,
    "readyforshutdown": true,
    "shutdowntriggered": true
  }
}

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

Earlier the triggerShutdown API would immediately shutdown the MS and if
it is the same MS on which API is called it would lead to error in the
API call. This change adds a delay to the process so the MS would be
able to send response to the API.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Copy link
Copy Markdown
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.

nice catch @shwstppr , CLGTM

@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan package

@DaanHoogland DaanHoogland added this to the 4.19.1.0 milestone Jun 20, 2024
@blueorangutan
Copy link
Copy Markdown

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

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 14.95%. Comparing base (7dce3d8) to head (bd2c496).
Report is 1 commits behind head on 4.19.

Additional details and impacted files
@@             Coverage Diff              @@
##               4.19    #9276      +/-   ##
============================================
- Coverage     14.95%   14.95%   -0.01%     
+ Complexity    11013    11006       -7     
============================================
  Files          5382     5382              
  Lines        470092   470095       +3     
  Branches      57685    59626    +1941     
============================================
- Hits          70311    70281      -30     
- Misses       391993   392031      +38     
+ Partials       7788     7783       -5     
Flag Coverage Δ
uitests 4.28% <ø> (ø)
unittests 15.66% <100.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.

@blueorangutan
Copy link
Copy Markdown

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

Copy link
Copy Markdown
Contributor

@sureshanaparti sureshanaparti left a comment

Choose a reason for hiding this comment

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

clgtm

@sureshanaparti
Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

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

@blueorangutan
Copy link
Copy Markdown

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

Test Result Time (s) Test File

@sureshanaparti
Copy link
Copy Markdown
Contributor

No issues with safe shutdown test, merging based on review / test result.

@sureshanaparti sureshanaparti merged commit 097359b into apache:4.19 Jun 21, 2024
@DaanHoogland DaanHoogland deleted the fix-trigger-shutdown branch June 21, 2024 06:27
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Jul 2, 2024
…#9276)

Earlier the triggerShutdown API would immediately shutdown the MS and if
it is the same MS on which API is called it would lead to error in the
API call. This change adds a delay to the process so the MS would be
able to send response to the API.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Abhishek's Bugfix List
Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants