sureshanaparti commented on code in PR #10417:
URL: https://github.com/apache/cloudstack/pull/10417#discussion_r1987147358


##########
plugins/maintenance/src/main/java/org/apache/cloudstack/maintenance/ManagementServerMaintenanceManagerImpl.java:
##########
@@ -319,22 +370,23 @@ public ManagementServerMaintenanceResponse 
triggerShutdown(TriggerShutdownCmd cm
         }
 
         if (State.Up.equals(msHost.getState())) {
+            final List<ManagementServerHostVO> 
preparingForMaintenanceOrShutDownMsList = 
msHostDao.listBy(State.PreparingForMaintenance, State.PreparingForShutDown);
+            if 
(CollectionUtils.isNotEmpty(preparingForMaintenanceOrShutDownMsList)) {
+                throw new CloudRuntimeException("Cannot trigger shutdown now, 
there are other management servers preparing for maintenance/shutdown");
+            }
             msHostDao.updateState(msHost.getId(), State.PreparingForShutDown);
         }

Review Comment:
   done



-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to