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
Based on #54, when background entity manager creation is enabled, the EntityManager is created in a separate thread. As part of EntityManager creation, it accesses the database to obtain database metadata. The JDBC access invokes a call to DataSourceObservationListener, which also triggers the ObjectProvider<ObservationRegistry> to lazily retrieve the ObservationRegistry bean for DataSourceObservationListener. Since this call is made in a separate thread, it causes a deadlock in the BeanFactory. (Details described in spring-projects/spring-framework#34247)
Originally, the lazy resolution of ObservationRegistry was introduced to avoid circular references with Micrometer registry, binders, and filters during Spring Boot startup. This behavior was addressed at some point (possibly in this commit).
To address this issue, change the DataSourceObservationListener bean definition to directly use the resolved ObservationRegistry bean instead of relying on ObjectProvider<ObservationRegistry>.
To preserve the existing ObjectProvider-based lazy resolution behavior, it could add a property to toggle this behavior.
The text was updated successfully, but these errors were encountered:
Based on #54, when background entity manager creation is enabled, the
EntityManager
is created in a separate thread. As part ofEntityManager
creation, it accesses the database to obtain database metadata. The JDBC access invokes a call toDataSourceObservationListener
, which also triggers theObjectProvider<ObservationRegistry>
to lazily retrieve theObservationRegistry
bean forDataSourceObservationListener
. Since this call is made in a separate thread, it causes a deadlock in theBeanFactory
. (Details described in spring-projects/spring-framework#34247)Originally, the lazy resolution of
ObservationRegistry
was introduced to avoid circular references with Micrometer registry, binders, and filters during Spring Boot startup. This behavior was addressed at some point (possibly in this commit).To address this issue, change the
DataSourceObservationListener
bean definition to directly use the resolvedObservationRegistry
bean instead of relying onObjectProvider<ObservationRegistry>
.To preserve the existing
ObjectProvider
-based lazy resolution behavior, it could add a property to toggle this behavior.The text was updated successfully, but these errors were encountered: