-
Notifications
You must be signed in to change notification settings - Fork 40.9k
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
2.5.4 upgrade, issue with actuator/metrics/AutoTimer, blocks startup #27809
Comments
Thanks for the report. Unfortunately, if you're unable to reproduce the problem with a complete application to base your attempt on, I think it's quite unlikely that we'll be able to figure it out from just the stack of a single thread. Making a somewhat educated guess, it appears that you're using a Spring Data Repository during application startup which is unusual. If you'd like us to spend some more time investigating, a sample that reproduces the problem really would be ideal. Failing that, we might be able to figure things out from a full thread dump during the hang along with a detailed description of what the application does and how it uses Spring Data repositories during startup. |
Hi @wilkinsona , thank you for your prompt reply. You are right, the problem has to do with some caching that is performed during the startup. Based on that i was able to reproduce that in a clean project (attached). You can check the stacktrace of the thread dump and that if you change the version to 2.5.3 or disable autotime, the application starts successfully The db schema:
|
The change in behaviour in 2.5.4 is due to #27591. This is a very similar to spring-projects/spring-framework#20904. In this case it's the deferred bean lookup in Generally speaking, you should avoid doing anything multi-threaded during application context refresh where there's any chance that one of those threads will interact with the bean factory. In this case, that includes calling a reactive Spring Data repository that performs network IO. You may want to consider using a We can take another look at the fix for #27591 as there was an alternative fix that we rejected at the time. I'm not sure if it'll fix this problem, and even if it did we may not want to switch to it, but it's worth considering at least. |
@wilkinsona thank you again for your enlightening answer. We will consider our options and delay these calls after startup has been completed |
We discussed this today and decided that we don't want to risk destabilising things by trying to workaround something that is really a Framework problem. Using a |
We have a Spring Boot application (webflux, r2dbc, spring data) using the version 2.5.3. After upgrading to 2.5.4 the application halts at startup. From the thread dump it seems that a thread is blocked during the initialization of AutoTimer in metrics.
Drilling down a bit more, it seems that the problem is specifically with the AutoTimer support in spring data repositories, so if you disable that, the application starts normally.
Unfortunatelly i could not reproduce that in a clean project with the same depedencies. Also the same issue appears in similar applications that have spring data but with cassandra connectivity this time.
The text was updated successfully, but these errors were encountered: