Description
Describe the bug
Spring redis get connection block when include spring-cloud-starter-zipkin.
2020-02-12 11:31:27.025 INFO [,,,] 25158 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.sleuth.zipkin2.sender.ZipkinRestTemplateSenderConfiguration' of type [org.springframework.cloud.sleuth.zipkin2.sender.ZipkinRestTemplateSenderConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-02-12 11:31:27.027 INFO [,,,] 25158 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'zipkinRestTemplateCustomizer' of type [org.springframework.cloud.sleuth.zipkin2.DefaultZipkinRestTemplateCustomizer] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-02-12 11:31:27.038 INFO [,,,] 25158 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'zipkinSender' of type [org.springframework.cloud.sleuth.zipkin2.sender.RestTemplateSender] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-02-12 11:31:27.075 WARN [,,,] 25158 --- [ main] o.s.c.s.zipkin2.ZipkinAutoConfiguration : Check result of the [AsyncReporter{org.springframework.cloud.sleuth.zipkin2.sender.RestTemplateSender@1dba4e06}] contains an error [CheckResult{ok=false, error=org.springframework.web.client.ResourceAccessException: I/O error on POST request for "http://localhost:9411/api/v2/spans": Connection refused (Connection refused); nested exception is java.net.ConnectException: Connection refused (Connection refused)}]
2020-02-12 11:31:27.076 INFO [,,,] 25158 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'zipkinReporter' of type [zipkin2.reporter.AsyncReporter$BoundedAsyncReporter] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-02-12 11:31:27.086 INFO [,,,] 25158 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'tracing' of type [brave.Tracing$Default] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-02-12 11:31:27.089 INFO [,,,] 25158 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.sleuth.redis-org.springframework.cloud.sleuth.instrument.redis.TraceRedisProperties' of type [org.springframework.cloud.sleuth.instrument.redis.TraceRedisProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-02-12 11:31:27.454 INFO [,,,] 25158 --- [ main] io.lettuce.core.EpollProvider : Starting without optional epoll library
2020-02-12 11:31:27.455 INFO [,,,] 25158 --- [ main] io.lettuce.core.KqueueProvider : Starting without optional kqueue library
If pom.xml not include spring-cloud-starter-zipkin, then redis success get connection.
Sample
Sample Project
block in io.lettuce.core.AbstractRedisClient#getConnection()
Activity
marcingrzejszczak commentedon Feb 12, 2020
@mp911de have you seen such a problem before?
mp911de commentedon Feb 12, 2020
Do you mean
Connection refused (Connection refused); nested exception is java.net.ConnectException: Connection refused (Connection refused)}]
or the bean-postprocesors?marcingrzejszczak commentedon Feb 12, 2020
From what I understand this the problem
block in io.lettuce.core.AbstractRedisClient#getConnection()
. All the entries in the logs are not related to the issue as far as I understand.BTW @WEIZIBIN you know that we have Hoxton.SR1 ?
mp911de commentedon Feb 12, 2020
The application startup gets stuck (blocked). There are two things that come together:
@PostConstruct
which awaits command completion since it's a blocking call.Since the context is not fully started, the startup lock prevents progress each time a thread different than
main
tries to obtain a Spring bean. Here's the stack trace of the blocked thread:WEIZIBIN commentedon Feb 12, 2020
Thanks, I have reached the same conclusion after using the jstack command. Has this issue been resolved now? @mp911de
WEIZIBIN commentedon Feb 12, 2020
I upgraded to Hoxton.SR1 and still have the same problem. @marcingrzejszczak
Comven commentedon Feb 12, 2020
spring-boot-2.2.4+spring-cloud Hoxton.SR1 have the same problem
WEIZIBIN commentedon Feb 12, 2020
My current solution is to execute it before redis executes the command.
tracing.tracer().nextSpan ();
Then [Main] thread initializes Tracer first, so when redis executes the command, the IO thread will not block at getSingleton().
Is there a better solution?
[-]spring redis get connection block when include spring-cloud-starter-zipkin [/-][+]spring lettuce startup get blocks when including spring-cloud-starter-zipkin [/+]21 remaining items