From e36ebc59696a6524f326e4de89d77767f8de8056 Mon Sep 17 00:00:00 2001 From: huazhongming Date: Mon, 22 Apr 2024 10:55:47 +0800 Subject: [PATCH] Fix readiness health check list mistake in parallel checking scenario (#1309) Signed-off-by: crazyhzm --- .../com/alipay/sofa/healthcheck/HealthCheckerProcessor.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sofa-boot-project/sofa-boot-core/healthcheck-sofa-boot/src/main/java/com/alipay/sofa/healthcheck/HealthCheckerProcessor.java b/sofa-boot-project/sofa-boot-core/healthcheck-sofa-boot/src/main/java/com/alipay/sofa/healthcheck/HealthCheckerProcessor.java index 2b4412904..aed67769f 100644 --- a/sofa-boot-project/sofa-boot-core/healthcheck-sofa-boot/src/main/java/com/alipay/sofa/healthcheck/HealthCheckerProcessor.java +++ b/sofa-boot-project/sofa-boot-core/healthcheck-sofa-boot/src/main/java/com/alipay/sofa/healthcheck/HealthCheckerProcessor.java @@ -158,12 +158,12 @@ public boolean readinessHealthCheck(Map healthMap) { String checkComponentNames = readinessHealthCheckers.values().stream() .map(HealthChecker::getComponentName).collect(Collectors.joining(",")); logger.info("SOFABoot HealthChecker readiness check {} item: {}.", - healthCheckers.size(), checkComponentNames); + readinessHealthCheckers.size(), checkComponentNames); boolean result; if (healthCheckProperties.isHealthCheckParallelEnable()) { - CountDownLatch countDownLatch = new CountDownLatch(healthCheckers.size()); + CountDownLatch countDownLatch = new CountDownLatch(readinessHealthCheckers.size()); AtomicBoolean parallelResult = new AtomicBoolean(true); - healthCheckers.forEach((String key, HealthChecker value) -> healthCheckExecutor.executeTask(() -> { + readinessHealthCheckers.forEach((String key, HealthChecker value) -> healthCheckExecutor.executeTask(() -> { try { if (!doHealthCheck(key, value, false, healthMap, true, false)) { parallelResult.set(false);