You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have this application with works fine with autoconfiguration of datasource-micrometer till 3.4.0 , the moment I have upgraded to 3.4.1 it is halting and never proceeding further
In src/test/java/com/example/learning/common/AbstractIntegrationTest.java I have added a property to turn on and off for replicating the issue. When autoconfiguration is disabled as default is on, everything works as expected.
The text was updated successfully, but these errors were encountered:
I debugged it and found this is where the hang happens when running DataSourceObservationListener.
observationRegistrySupplier.get() is a supplier that lazily gets an ObservationRegistry bean.
The actual supplier is a lambda from DataSourceObservationAutoConfiguration#L99 which is an ObjectProvider<ObservationRegistry>.
The DataSourceObservationListener is called while spring is creating a LocalContainerEntityManagerFactoryBean bean in a separate thread and trying to access the database to obtain metadata - AbstractEntityManagerFactoryBean#L397
I suspect there is some locks in spring trying to retrieve a bean via ObjectProvider while another bean(LocalContainerEntityManagerFactoryBean) is in creation.
I need to investigate more details but this is so far what I found.
To workaround/solve the problem on your app, you need to change the spring.data.jpa.repositories.bootstrap-mode property to default, so that EntityManager and all related beans are created on the main thread.
Since I have created #56, I am closing this issue.
I have this application with works fine with autoconfiguration of datasource-micrometer till 3.4.0 , the moment I have upgraded to 3.4.1 it is halting and never proceeding further
In
src/test/java/com/example/learning/common/AbstractIntegrationTest.java
I have added a property to turn on and off for replicating the issue. When autoconfiguration is disabled as default is on, everything works as expected.The text was updated successfully, but these errors were encountered: