Derby
  1. Derby
  2. DERBY-4109

Java-level deadlock in XATransactionState

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: 10.4.2.0
    • Fix Version/s: None
    • Component/s: JDBC
    • Environment:
      Linux, Sun jdk 1.6.0_12 (64-bit)
    • Urgency:
      Normal
    • Bug behavior facts:
      Crash, Seen in production

      Description

      Due to some other issue in derby (a hang in ActiveLock.waitForGrant
      while executing a prepared-statement), the transaction times out at
      which point Derby hits the following java-level deadlock (from the
      jvm thread-dump):

      Found one Java-level deadlock:
      =============================
      "Thread-6":
      waiting to lock monitor 0x00002aaaf43d2ec8 (object 0x00002aaadcce9070, a org.apache.derby.jdbc.XATransactionState),
      which is held by "Timer-0"
      "Timer-0":
      waiting to lock monitor 0x00002aaaf43d75a8 (object 0x00002aaadcce2e60, a org.apache.derby.impl.jdbc.EmbedConnection40),
      which is held by "Thread-6"

      Java stack information for the threads listed above:
      ===================================================
      "Thread-6":
      at org.apache.derby.jdbc.XATransactionState.cleanupOnError(Unknown Source)

      • waiting to lock <0x00002aaadcce9070> (a org.apache.derby.jdbc.XATransactionState)
        at org.apache.derby.iapi.services.context.ContextManager.cleanupOnError(Unknown Source)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.cleanupOnError(Unknown Source)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
      • locked <0x00002aaadcce2e60> (a org.apache.derby.impl.jdbc.EmbedConnection40)
        at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
      • locked <0x00002aaadcce2e60> (a org.apache.derby.impl.jdbc.EmbedConnection40)
        at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
        at org.apache.derby.iapi.jdbc.BrokeredStatement.execute(Unknown Source)
        at org.fedoracommons.akubra.txn.derby.TransactionalConnection.beforeCompletion(TransactionalConnection.java:293)
        at bitronix.tm.BitronixTransaction.fireBeforeCompletionEvent(BitronixTransaction.java:366)
        at bitronix.tm.BitronixTransaction.commit(BitronixTransaction.java:142)
        at bitronix.tm.BitronixTransactionManager.commit(BitronixTransactionManager.java:96)
        at org.fedoracommons.akubra.txn.derby.TestTransactionalStore.doInTxn(TestTransactionalStore.java:759)
        at org.fedoracommons.akubra.txn.derby.TestTransactionalStore.access$900(TestTransactionalStore.java:60)
        at org.fedoracommons.akubra.txn.derby.TestTransactionalStore$4.erun(TestTransactionalStore.java:586)
        at org.fedoracommons.akubra.txn.derby.TestTransactionalStore$ERunnable.run(TestTransactionalStore.java:803)
        at java.lang.Thread.run(Thread.java:619)
        "Timer-0":
        at org.apache.derby.impl.jdbc.EmbedConnection.xa_rollback(Unknown Source)
      • waiting to lock <0x00002aaadcce2e60> (a org.apache.derby.impl.jdbc.EmbedConnection40)
        at org.apache.derby.jdbc.XATransactionState.cancel(Unknown Source)
      • locked <0x00002aaadcce9070> (a org.apache.derby.jdbc.XATransactionState)
        at org.apache.derby.jdbc.XATransactionState.access$000(Unknown Source)
        at org.apache.derby.jdbc.XATransactionState$CancelXATransactionTask.run(Unknown Source)
        at java.util.TimerThread.mainLoop(Timer.java:512)
        at java.util.TimerThread.run(Timer.java:462)

      Found 1 deadlock.

        Activity

        Hide
        Ronald Tschalaer added a comment -

        Bumping the severity because I've been getting this quite often, and a java-level deadlock
        really prevents this from being used in a production environment.

        Show
        Ronald Tschalaer added a comment - Bumping the severity because I've been getting this quite often, and a java-level deadlock really prevents this from being used in a production environment.
        Hide
        Kathey Marsden added a comment -

        Do you have a reproduction for this issue?

        Show
        Kathey Marsden added a comment - Do you have a reproduction for this issue?
        Hide
        Rick Hillegas added a comment -

        Triaged July 2, 2009: Noted that this is seen in production.

        Show
        Rick Hillegas added a comment - Triaged July 2, 2009: Noted that this is seen in production.

          People

          • Assignee:
            Unassigned
            Reporter:
            Ronald Tschalaer
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development