Uploaded image for project: 'Agroal'
  1. Agroal
  2. AG-204

TimeoutException in ConnectionPool.handlerFromSharedCache

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • None
    • 1.17
    • None
    • None
    • False
    • Hide

      None

      Show
      None
    • False

      After upgrading Agroal to 1.17 which should have fixed AG-201, some users are reportedly still experiencing java.util.concurrent.TimeoutException in ConnectionPool.handlerFromSharedCache call with H2 database.

      The reported workaround is to downgrade agroal to 1.15.

      The full stack trace is listed below.

      I was so far not successful with creating a reliable reproducer.

      2023-04-13 10:17:04,366 WARN  [org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator] (JPA Startup Thread: keycloak-default) HHH000342: Could not obtain connection to query metadata: java.sql.SQLException: Acquisition timeout while waiting for new connection
              at io.agroal.pool.ConnectionPool.handlerFromSharedCache(ConnectionPool.java:321)
              at io.agroal.pool.ConnectionPool.getConnection(ConnectionPool.java:249)
              at io.agroal.pool.DataSource.getConnection(DataSource.java:86)
              at io.quarkus.hibernate.orm.runtime.customized.QuarkusConnectionProvider.getConnection(QuarkusConnectionProvider.java:23)
              at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess.obtainConnection(JdbcEnvironmentInitiator.java:181)
              at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:68)
              at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:35)
              at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:101)
              at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:263)
              at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:237)
              at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214)
              at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:51)
              at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:107)
              at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:246)
              at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214)
              at org.hibernate.boot.internal.SessionFactoryOptionsBuilder.<init>(SessionFactoryOptionsBuilder.java:272)
              at io.quarkus.hibernate.orm.runtime.recording.PrevalidatedQuarkusMetadata.buildSessionFactoryOptionsBuilder(PrevalidatedQuarkusMetadata.java:68)
              at io.quarkus.hibernate.orm.runtime.boot.FastBootEntityManagerFactoryBuilder.build(FastBootEntityManagerFactoryBuilder.java:72)
              at io.quarkus.hibernate.orm.runtime.FastBootHibernatePersistenceProvider.createEntityManagerFactory(FastBootHibernatePersistenceProvider.java:72)
              at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:80)
              at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55)
              at io.quarkus.hibernate.orm.runtime.JPAConfig$LazyPersistenceUnit.get(JPAConfig.java:165)
              at io.quarkus.hibernate.orm.runtime.JPAConfig$1.run(JPAConfig.java:66)
              at java.base/java.lang.Thread.run(Thread.java:834)
      Caused by: java.util.concurrent.TimeoutException
              at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:204)
              at io.agroal.pool.ConnectionPool.handlerFromSharedCache(ConnectionPool.java:298)
              ... 23 more
      

              lbarreiro-1 Luis Barreiro
              hmlnarik@redhat.com Hynek Mlnařík (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: