You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "erikbocks (via GitHub)" <gi...@apache.org> on 2026/10/14 16:53:07 UTC

[PR] Rewrite of email alert about VR health checks [cloudstack]

erikbocks opened a new pull request, #14403:
URL: https://github.com/apache/cloudstack/pull/14403

   ### Description
   
   When one or more VR health checks fail and alert notifications are configured in the environment, an email that does not include details about which tests failed is sent. The message has been rewritten to display which health checks have failed.
   
   ### 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)
   - [X] 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
   - [X] Minor
   
   ### Screenshots (if appropriate):
   
   <details><summary>Alert received</summary>
   
   <img width="1526" height="357" alt="image" src="https://github.com/user-attachments/assets/ddbeba93-5552-4e26-936a-1fa91123cfeb" />
   
   </details>
   
   ### How Has This Been Tested?
   
   Build the packages and installed them. Then, I created a new Isolated network and deploy a VM on it. The VR was accessed by console and the `openssh-server` package was purged. After that, I requested for fresh checks. As it could not access the VR via SSH, all the tests failed and an email was sent informing about the failure to access the Instance (image attached to the **Screenshots** section) 


-- 
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] Rewrite of email alert about VR health checks [cloudstack]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #14403:
URL: https://github.com/apache/cloudstack/pull/14403#issuecomment-6276295779

   This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.


-- 
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] Rewrite of email alert about VR health checks [cloudstack]

Posted by "Damans227 (via GitHub)" <gi...@apache.org>.
Damans227 commented on code in PR #14403:
URL: https://github.com/apache/cloudstack/pull/14403#discussion_r4273974187


##########
server/src/main/java/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java:
##########
@@ -1160,23 +1159,33 @@ private void handleFailingChecks(DomainRouterVO router, List<String> failingChec
         if (CollectionUtils.isEmpty(failingChecks)) {
             return;
         }
+        String subject = String.format("Failed health checks on router [%s]", router.getName());
+        String alertMessage = String.format("The following health checks have failed on router [%s] with UUID [%s]: ", router.getName(), router.getUuid());
+        ArrayList<String> failedChecks = new ArrayList<>();
+        for (String failedCheckName : failingChecks) {
+            RouterHealthCheckResultVO routerHealthCheckResultVO = routerHealthCheckResultDao.getRouterHealthCheckResult(router.getId(), failedCheckName, null);
+            String failedCheckDetails = routerHealthCheckResultVO.getParsedCheckDetails();

Review Comment:
   what happens if there is no saved result for a failing check? looks like it crashes here and the router recreate and the other routers get skipped



-- 
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] Rewrite of email alert about VR health checks [cloudstack]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #14403:
URL: https://github.com/apache/cloudstack/pull/14403#issuecomment-6173924736

   ## [Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/14403?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 3.69%. Comparing base ([`602d9ec`](https://app.codecov.io/gh/apache/cloudstack/commit/602d9ec3e03e6350b55dd1349118ea2ccb766cca?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`6838f62`](https://app.codecov.io/gh/apache/cloudstack/commit/6838f628062c1b6ccb6ef724cd0f4efa56db8185?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 10 commits behind head on main.
   > :exclamation:  There is a different number of reports uploaded between BASE (602d9ec) and HEAD (6838f62). Click for more details.
   > 
   > <details><summary>HEAD has 1 upload less than BASE</summary>
   >
   >| Flag | BASE (602d9ec) | HEAD (6838f62) |
   >|------|------|------|
   >|unittests|1|0|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@              Coverage Diff              @@
   ##               main   #14403       +/-   ##
   =============================================
   - Coverage     19.91%    3.69%   -16.23%     
   =============================================
     Files          6373      491     -5882     
     Lines        577230    42220   -535010     
     Branches      70696     7974    -62722     
   =============================================
   - Hits         114974     1558   -113416     
   + Misses       449690    40436   -409254     
   + Partials      12566      226    -12340     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/14403/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/14403/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `3.69% <ø> (-0.03%)` | :arrow_down: |
   | [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/14403/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 Harness](https://app.codecov.io/gh/apache/cloudstack/pull/14403?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).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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] Rewrite of email alert about VR health checks [cloudstack]

Posted by "erikbocks (via GitHub) via commits" <co...@cloudstack.apache.org>.
erikbocks commented on code in PR #14403:
URL: https://github.com/apache/cloudstack/pull/14403#discussion_r4567467451


##########
server/src/main/java/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java:
##########
@@ -1160,23 +1159,33 @@ private void handleFailingChecks(DomainRouterVO router, List<String> failingChec
         if (CollectionUtils.isEmpty(failingChecks)) {
             return;
         }
+        String subject = String.format("Failed health checks on router [%s]", router.getName());
+        String alertMessage = String.format("The following health checks have failed on router [%s] with UUID [%s]: ", router.getName(), router.getUuid());
+        ArrayList<String> failedChecks = new ArrayList<>();
+        for (String failedCheckName : failingChecks) {
+            RouterHealthCheckResultVO routerHealthCheckResultVO = routerHealthCheckResultDao.getRouterHealthCheckResult(router.getId(), failedCheckName, null);
+            String failedCheckDetails = routerHealthCheckResultVO.getParsedCheckDetails();

Review Comment:
   Hello, @Damans227 
   
   I checked the behavior that you mentioned about no saved result for a failing check and could not find a flow where this happens. 
   
   In the code, the router checks are parsed and saved to the database in the `getFailingChecks` method, before this piece of code. Even in scenarios where the command is not received by the router, or the router's file system is not writable, there is a separate handling to tackle those. This means that, even if the router does not have any check yet, the new checks will be persisted before the failing check handling is done.
   
   To validate this, I created a VR locally and filled its volume with a dummy file created by `dd`, for the `disk_space_check.py` test to fail. With no tests registered yet, I requested fresh checks and validated with the IDE's debugging tool that all the checks were persisted before the handling part.
   
   Have you seen any specific scenario of this happening, so we can test this solution and validate its behavior?



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