Caused by: java.lang.IllegalStateException: block()/blockFirst()/blockLast() are blocking, which is not supported in thread reactor-http-epoll-3
    at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:77)
    at reactor.core.publisher.Mono.block(Mono.java:1494)
    at org.springframework.data.redis.connection.ReactiveRedisConnection.close(ReactiveRedisConnection.java:60)
    at org.springframework.boot.actuate.redis.RedisReactiveHealthIndicator.lambda$doHealthCheck$1(RedisReactiveHealthIndicator.java:50)
    at reactor.core.publisher.FluxDoFinally$DoFinallySubscriber.runFinally(FluxDoFinally.java:156)
    ... 203 common frames omitted

While running a Spring Cloud Gateway application with Redis as session store, I observed the stack trace above. The cause is a blocking call in: https://github.com/spring-projects/spring-boot/blob/master/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/redis/RedisReactiveHealthIndicator.java#L49

There is a Mono<Void> closeLater(); https://github.com/spring-projects/spring-data-redis/blob/master/src/main/java/org/springframework/data/redis/connection/ReactiveRedisConnection.java#L68 which could be called instead.

Comment From: mp911de

There's also another issue here: Connection creation is blocking if connection sharing is disabled. From that perspective, either you allocate a connection on subscribeOn(Schedulers.parallel()) or you obtain the connection in afterPropertiesSet().

Comment From: wilkinsona

Closing in favour of #16756.

Comment From: upwan111

hi, i am using currently 2.1.5.RELEASE of spring-data-redis with 2.1.3.RELEASE of spring-boot-actuator and facing this issue in my application. Can I get any information which release version this error will be fixed so that we can update accordingly?

Comment From: wilkinsona

@upwan111 The issue was fixed in Spring Boot 2.1.5. Please see #16756, linked to above, for further details.

Comment From: Joan7

Currently I am using 2.1.5.RELEASE of spring-data-redis facing this issue in frequently.My usage on redis is call from redisratelimiter class. Can anyone help on it?

Comment From: Joan7

@upwan111 The issue was fixed in Spring Boot 2.1.5. Please see #16756, linked to above, for further details.

My service hang on request on this failure in 2.1.5 springboot

Comment From: wilkinsona

@JoanJ We believe this issue has been fixed by the pull request referenced above. If you're seeing a similar problem, please open a new issue providing as much detail as possible and, ideally, a small sample that reproduces the problem.