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 <sumesh@appsmith.com>
This commit is contained in:
parent
99466e197d
commit
72bee7b26e
|
|
@ -35,16 +35,20 @@ public class HealthCheckServiceCEImpl implements HealthCheckServiceCE {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Mono<Health> getRedisHealth() {
|
public Mono<Health> getRedisHealth() {
|
||||||
Function<TimeoutException, Throwable> healthTimeout = error -> new AppsmithException(
|
Function<TimeoutException, Throwable> healthTimeout = error -> {
|
||||||
AppsmithError.HEALTHCHECK_TIMEOUT, "Redis");
|
log.warn("Redis health check timed out: ", error.getMessage());
|
||||||
|
return new AppsmithException(AppsmithError.HEALTHCHECK_TIMEOUT, "Redis");
|
||||||
|
};
|
||||||
RedisReactiveHealthIndicator redisReactiveHealthIndicator = new RedisReactiveHealthIndicator(reactiveRedisConnectionFactory);
|
RedisReactiveHealthIndicator redisReactiveHealthIndicator = new RedisReactiveHealthIndicator(reactiveRedisConnectionFactory);
|
||||||
return redisReactiveHealthIndicator.health().timeout(Duration.ofSeconds(3)).onErrorMap(TimeoutException.class, healthTimeout);
|
return redisReactiveHealthIndicator.health().timeout(Duration.ofSeconds(3)).onErrorMap(TimeoutException.class, healthTimeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Mono<Health> getMongoHealth() {
|
public Mono<Health> getMongoHealth() {
|
||||||
Function<TimeoutException, Throwable> healthTimeout = error -> new AppsmithException(
|
Function<TimeoutException, Throwable> healthTimeout = error -> {
|
||||||
AppsmithError.HEALTHCHECK_TIMEOUT, "Mongo");
|
log.warn("MongoDB health check timed out: ", error.getMessage());
|
||||||
|
return new AppsmithException(AppsmithError.HEALTHCHECK_TIMEOUT, "Mongo");
|
||||||
|
};
|
||||||
MongoReactiveHealthIndicator mongoReactiveHealthIndicator = new MongoReactiveHealthIndicator(reactiveMongoTemplate);
|
MongoReactiveHealthIndicator mongoReactiveHealthIndicator = new MongoReactiveHealthIndicator(reactiveMongoTemplate);
|
||||||
return mongoReactiveHealthIndicator.health().timeout(Duration.ofSeconds(1)).onErrorMap(TimeoutException.class, healthTimeout);
|
return mongoReactiveHealthIndicator.health().timeout(Duration.ofSeconds(1)).onErrorMap(TimeoutException.class, healthTimeout);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user