From 72bee7b26e4e6be34ba8a2dbda390b3ac711e81c Mon Sep 17 00:00:00 2001 From: Shrikant Sharat Kandula Date: Wed, 17 May 2023 10:19:52 +0530 Subject: [PATCH] chore: Log timeout error information (#23071) Hopefully, this should give us information on what's the cause for the timeout errors. --------- Co-authored-by: Sumesh Pradhan --- .../server/services/ce/HealthCheckServiceCEImpl.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/HealthCheckServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/HealthCheckServiceCEImpl.java index ead2be857a..792fc42da0 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/HealthCheckServiceCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/HealthCheckServiceCEImpl.java @@ -35,16 +35,20 @@ public class HealthCheckServiceCEImpl implements HealthCheckServiceCE { @Override public Mono getRedisHealth() { - Function healthTimeout = error -> new AppsmithException( - AppsmithError.HEALTHCHECK_TIMEOUT, "Redis"); + Function healthTimeout = error -> { + log.warn("Redis health check timed out: ", error.getMessage()); + return new AppsmithException(AppsmithError.HEALTHCHECK_TIMEOUT, "Redis"); + }; RedisReactiveHealthIndicator redisReactiveHealthIndicator = new RedisReactiveHealthIndicator(reactiveRedisConnectionFactory); return redisReactiveHealthIndicator.health().timeout(Duration.ofSeconds(3)).onErrorMap(TimeoutException.class, healthTimeout); } @Override public Mono getMongoHealth() { - Function healthTimeout = error -> new AppsmithException( - AppsmithError.HEALTHCHECK_TIMEOUT, "Mongo"); + Function healthTimeout = error -> { + log.warn("MongoDB health check timed out: ", error.getMessage()); + return new AppsmithException(AppsmithError.HEALTHCHECK_TIMEOUT, "Mongo"); + }; MongoReactiveHealthIndicator mongoReactiveHealthIndicator = new MongoReactiveHealthIndicator(reactiveMongoTemplate); return mongoReactiveHealthIndicator.health().timeout(Duration.ofSeconds(1)).onErrorMap(TimeoutException.class, healthTimeout); }