-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Spring Boot startup with Lettuce and Micrometer metrics runs into Spring context singleton lock #2814
Comments
Please attach a thread dump to inspect why the application is hanging. |
Hello, |
The netty thread Here's the trace of the blocked thread:
That isn't something we can fix in Spring Data Redis because the metrics recorder is trying to access a bean from the Spring context. Paging @marcingrzejszczak and @wilkinsona. I think it is best to create a issue at https://github.com/spring-projects/spring-boot/issues for the time being. |
cc @jonatan-ivanov - exemplars and early bean accessing again |
Now I tested it also with Spring Boot 3.2.1. The problem is still there. Is there a ticket in one of the other projects or should I open one? |
Waiting for @jonatan-ivanov to look at this |
I'm not sure what is going on in this case but the issue we are facing approximately looks like this:
This is a circular dependency that supposed to be resolved using It seems when Lettuce tries to record metrics, Micrometer tries to get the As a workaround, if you don't need exemplars, you can either create your own |
If I inject a Tracer or a _MeterRegistry with a Bean in the application class, then I cannot start the context.
Currently I have no idea, where I can inject it in a better way before the Redis configuration is loaded. But I will also test the workaround with an own PrometheusMeterRegistry. Error Message:
|
The workaround doesn't work for us. Without a sampler the service starts, but all metrics are gone. With the SpanContextSampler the service doesn't start (like before). This is our configuration:
|
The "noop" SpanContextSupplier also results in no metrics:
|
Injecting the Tracer in the prometheusMeterRegistry Bean also results in the stucking behaviour:
Log message:
|
I am encountering the same problem in my project.
Here are my thoughts:
|
I can confirm it. In my case it is now working too. Here is the complete config:
Maybe it is important to mention, that one has to import the correct tracer. It works with "import io.micrometer.tracing.Tracer". |
Was there a more permanent solution identified? |
Hello together,
we updated our Spring Boot Service from version 3.1.6 to version 3.2.0 (Spring Cloud version 2023.0.0). The application connects via Spring data (lettuce) to a Redis Sentinel deployment. For an encrypted connection to Redis it uses ssl bundles. With Spring Boot 3.1.6 everything works fine. But after the update to the new version, the application is not starting anymore. With trace logging we see these messages (some messages are masked with XXX):
The “Decode done, empty stack: true” message is the last one in the log. Afterwards the application stucks and seems to wait for something.
We haven’t tested it in a minimal local setup, but maybe someone is able to see anything. I have found the following GitHub thread with a lettuce issue: redis/lettuce#2379 Maybe it is related.
For us it is a critical problem, because we need the updates.
All the best
Nicolas Billen
The text was updated successfully, but these errors were encountered: