Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-5670

Deadlock when the configured max db connections number is less than number of threads accessing database

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Low
    • 3.0
    • 2.6 M5
    • Triggers, Upgrading
    • None

    Description

      during the UpgradeTask1825 it is very likely that hibernate's id generator will have to access db to reset the id boundaries. When doing that it requires a new connection and because the connection pool would be used up by upgrade threads it will wait forever to acquire a connection (since the threads will not give one up until they finish and they cannot finish because they also access synchronized id generation method).

      UpgradeTask:pool-4-thread-7 [WAITING] CPU time: 0:00
      java.lang.Object.wait(long)
      com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(long)
      com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(long)
      com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(long)
      com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection()
      com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection()
      net.sf.hibernate.connection.C3P0ConnectionProvider.getConnection()
      net.sf.hibernate.impl.BatcherImpl.openConnection()
      net.sf.hibernate.id.TableGenerator.generate(SessionImplementor, Object)
      com.atlassian.hibernate.ResettableTableHiLoGenerator.generate(SessionImplementor, Object)
      
      ....
      UpgradeTask:pool-4-thread-6 [BLOCKED] CPU time: 0:00
      com.atlassian.hibernate.ResettableTableHiLoGenerator.generate(SessionImplementor, Object)
      net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(Object, Cascades$CascadingAction, Object)
      net.sf.hibernate.impl.SessionImpl.save(Object)
      net.sf.hibernate.impl.SessionImpl.saveOrUpdate(Object)
      org.springframework.orm.hibernate.HibernateTemplate$12.doInHibernate(Session)
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              akazatchkov Anatoli
              Votes:
              2 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: