-
Notifications
You must be signed in to change notification settings - Fork 975
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blockhound detects block call in DefaultConnectionFuture #1692
Comments
That's a Spring Data Redis issue where you need to enable eager connection factory initialization. |
Hey @mp911de, first of all, thanks for your answer. I tried to use eager connection factory initialization, however now I'm getting the following error when trying to connect to redis during application startup:
After getting this, I also tried to change the related beans (
My current simple config is:
Am I missing something important here? Thanks for your help! |
That is the natural consequence. Either you can initialize the connection at startup and move blocking calls onto the main thread or lazy initialization on the first access where blocking calls happen on the thread that requests the connection. |
Bug Report
While testing we detected a blocking call in lettuce client, specifically in the class DefaultConnectionFuture.
How could we avoid this block call?
Lettuce version: 6.0.1.RELEASE
Stack trace: at java.base/jdk.internal.misc.Unsafe.park(Unsafe.java) ~[na:na] at java.base/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194) ~[na:na] at java.base/java.util.concurrent.CompletableFuture$Signaller.block(CompletableFuture.java:1796) ~[na:na] at java.base/java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3128) ~[na:na] at java.base/java.util.concurrent.CompletableFuture.waitingGet(CompletableFuture.java:1823) ~[na:na] at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1998) ~[na:na] at io.lettuce.core.DefaultConnectionFuture.get(DefaultConnectionFuture.java:69) ~[lettuce-core-6.0.1.RELEASE.jar:6.0.1.RELEASE] at io.lettuce.core.AbstractRedisClient.getConnection(AbstractRedisClient.java:315) ~[lettuce-core-6.0.1.RELEASE.jar:6.0.1.RELEASE] at io.lettuce.core.RedisClient.connect(RedisClient.java:211) ~[lettuce-core-6.0.1.RELEASE.jar:6.0.1.RELEASE] at org.springframework.data.redis.connection.lettuce.StandaloneConnectionProvider.lambda$getConnection$1(StandaloneConnectionProvider.java:115) ~[spring-data-redis-2.4.1.jar:2.4.1] at java.base/java.util.Optional.orElseGet(Optional.java:369) ~[na:na] at org.springframework.data.redis.connection.lettuce.StandaloneConnectionProvider.getConnection(StandaloneConnectionProvider.java:115) ~[spring-data-redis-2.4.1.jar:2.4.1] at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$ExceptionTranslatingConnectionProvider.getConnection(LettuceConnectionFactory.java:1459) ~[spring-data-redis-2.4.1.jar:2.4.1] at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$SharedConnection.getNativeConnection(LettuceConnectionFactory.java:1247) ~[spring-data-redis-2.4.1.jar:2.4.1] at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$SharedConnection.getConnection(LettuceConnectionFactory.java:1230) ~[spring-data-redis-2.4.1.jar:2.4.1] at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory.getSharedReactiveConnection(LettuceConnectionFactory.java:989) ~[spring-data-redis-2.4.1.jar:2.4.1] at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory.getReactiveConnection(LettuceConnectionFactory.java:445) ~[spring-data-redis-2.4.1.jar:2.4.1] at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory.getReactiveConnection(LettuceConnectionFactory.java:98) ~[spring-data-redis-2.4.1.jar:2.4.1] at org.springframework.data.redis.core.ReactiveRedisTemplate.lambda$doInConnection$0(ReactiveRedisTemplate.java:198) ~[spring-data-redis-2.4.1.jar:2.4.1]
Thanks in advance.
The text was updated successfully, but these errors were encountered: