Skip to content
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

ReactiveRedisConnection close is blocking [DATAREDIS-1095] #1665

Closed
spring-projects-issues opened this issue Feb 5, 2020 · 2 comments
Closed
Assignees

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Feb 5, 2020

lovelywxd opened DATAREDIS-1095 and commented

I got the following in my logs

 Operator called default onErrorDropped

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:1663)
	at org.springframework.data.redis.connection.ReactiveRedisConnection.close(ReactiveRedisConnection.java:60)
	at org.springframework.data.redis.core.script.DefaultReactiveScriptExecutor.lambda$execute$7(DefaultReactiveScriptExecutor.java:167)
	at reactor.core.publisher.FluxDoFinally$DoFinallySubscriber.runFinally(FluxDoFinally.java:156)
	at reactor.core.publisher.FluxDoFinally$DoFinallySubscriber.cancel(FluxDoFinally.java:145)
	at org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.cancel(ScopePassingSpanSubscriber.java:87)
	at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.drainLoop(Operators.java:2013)
	at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.drain(Operators.java:1982)
	at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.cancel(Operators.java:1794)
	at org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.cancel(ScopePassingSpanSubscriber.java:87)
	at reactor.core.publisher.MonoReduceSeed$ReduceSeedSubscriber.cancel(MonoReduceSeed.java:96)
	at org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.cancel(ScopePassingSpanSubscriber.java:87)
	at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.cancel(FluxMapFuseable.java:167)
	at org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.cancel(ScopePassingSpanSubscriber.java:87)
	at reactor.core.publisher.Operators.terminate(Operators.java:1070)

my spring-boot verison is 2.2.1, spring-data-redis version is 2.2.1
I see this same question (https://jira.spring.io/browse/DATAREDIS-999). it said this question has solved in version 2.2.0. it  happend in my project again. 
so I don't know how to fix this question.
my code is below:

Flux<List<Long>> flux = this.redisTemplate.execute(this.script, keys, scriptArgs);

I see this exception is still throwed in 
 

@Override default void close() { closeLater().block(); }

I don't know why it should call block() if connection close async. 


Affects: 2.2.4 (Moore SR4)

Issue Links:

  • DATAREDIS-1077 ReactiveRedisTemplate calling the blocking close() from DefaultReactiveScriptExecutor
    ("duplicates")
  • DATAREDIS-1116 ReactiveRedisConnection close method is blocking
    ("is duplicated by")

Referenced from: pull request #509

Backported to: 2.2.5 (Moore SR5), 2.1.16 (Lovelace SR16)

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Feb 5, 2020

Mark Paluch commented

This issue is slightly different. While we fixed the blocking call in ReactiveRedisTemplate this issue is about DefaultReactiveScriptExecutor. Someone asked in DATAREDIS-999 also for the script executor but since it was a closed ticket the comment got lost and no one followed up. We need to fix the script executor call

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Feb 5, 2020

lovelywxd commented

Thanks for the update。Yes, As you said, �I find that it is ReactiveRedisTemplate in DATAREDIS-999, but this issue is about DefaultReactiveScriptExecutor.
then I still have some questions below:

  1. What's the impact of this exception? This exception seem to be happened when connection close. I don't know whether the connection resources will be released or not.
  2. how can I fix this error, or how to use correctly reactiveRedisTemplate. Actually, my spring-boot version is 2.1.5 (spring-data-redis version 2.1.8) when I come across the excecption. I try to upgrde version to fix this error, but it is not easy for my project in fact. So I want to konw how to use correctly if I want to use reactive-redis in spring-data-redis version 2.1.8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants