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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to