From c50d2b20905776ab0155efce4f4189af0f4bf04e Mon Sep 17 00:00:00 2001 From: Yaqin Li Date: Sat, 27 Jul 2024 00:39:51 +0000 Subject: [PATCH] make sure there is running hosts when marking deploy state as succeeding --- .../java/com/pinterest/deployservice/handler/CommonHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy-service/common/src/main/java/com/pinterest/deployservice/handler/CommonHandler.java b/deploy-service/common/src/main/java/com/pinterest/deployservice/handler/CommonHandler.java index 6b0e625bc7..f536bcca5c 100644 --- a/deploy-service/common/src/main/java/com/pinterest/deployservice/handler/CommonHandler.java +++ b/deploy-service/common/src/main/java/com/pinterest/deployservice/handler/CommonHandler.java @@ -312,7 +312,7 @@ void transition(DeployBean deployBean, DeployBean newDeployBean, EnvironBean env newDeployBean.setLast_update(System.currentTimeMillis()); //The maximum sucThreshold is 10000 to keep precision. - if (succeeded * 10000 >= sucThreshold * total) { + if (succeeded * 10000 >= sucThreshold * total && succeeded > 0) { LOG.debug("Propose deploy {} as SUCCEEDING since {} agents are succeeded.", deployId, succeeded); if (deployBean.getSuc_date() == null) { newDeployBean.setSuc_date(System.currentTimeMillis());