Derby
  1. Derby
  2. DERBY-764

java level dead lock when jar operataion are running in parallel in different transactions.

    Details

    • Urgency:
      Normal

      Description

      Found one Java-level deadlock:
      =============================
      "Thread-2":
      waiting to lock monitor 0x00a8872c (object 0x03002be8, a org.apache.derby.impl
      .services.locks.LockSet),
      which is held by "Thread-0"
      "Thread-0":
      waiting to lock monitor 0x00a8882c (object 0x03022168, a org.apache.derby.impl
      .services.reflect.UpdateLoader),
      which is held by "Thread-2"

      Java stack information for the threads listed above:
      ===================================================
      "Thread-2":
      at org.apache.derby.impl.services.locks.LockSet.lockObject(LockSet.java:
      294)

      • waiting to lock <0x03002be8> (a org.apache.derby.impl.services.locks.L
        ockSet)
        at org.apache.derby.impl.services.locks.SinglePool.lockAnObject(SinglePo
        ol.java:174)
        at org.apache.derby.impl.services.locks.SinglePool.lockObject(SinglePool
        .java:226)
        at org.apache.derby.impl.services.reflect.UpdateLoader.lockClassLoader(U
        pdateLoader.java:265)
        at org.apache.derby.impl.services.reflect.UpdateLoader.modifyJar(UpdateL
        oader.java:219)
      • locked <0x03022168> (a org.apache.derby.impl.services.reflect.UpdateLo
        ader)
        at org.apache.derby.impl.services.reflect.DatabaseClasses.notifyModifyJa
        r(DatabaseClasses.java:255)
        at org.apache.derby.impl.sql.execute.JarUtil.notifyLoader(JarUtil.java:4
        01)
        at org.apache.derby.impl.sql.execute.JarUtil.add(JarUtil.java:135)
        at org.apache.derby.impl.sql.execute.JarUtil.add(JarUtil.java:104)
        at org.apache.derby.impl.sql.execute.AddJarConstantAction.executeConstan
        tAction(AddJarConstantAction.java:96)
        at org.apache.derby.impl.sql.execute.JarDDL.add(JarDDL.java:45)
        at org.apache.derby.catalog.SystemProcedures.INSTALL_JAR(SystemProcedure
        s.java:1011)
        at org.apache.derby.exe.ac2753c07bx0108x308exa52cxffffec5b7c421.g0(Unkno
        wn Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
        java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
        sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.derby.impl.services.reflect.ReflectMethod.invoke(ReflectMe
        thod.java:45)
        at org.apache.derby.impl.sql.execute.CallStatementResultSet.open(CallSta
        tementResultSet.java:67)
        at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPre
        paredStatement.java:368)
        at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedState
        ment.java:1142)
      • locked <0x03141448> (a org.apache.derby.impl.jdbc.EmbedConnection30)
        at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java
        :550)
      • locked <0x03141448> (a org.apache.derby.impl.jdbc.EmbedConnection30)
        at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java
        :480)
        at org.apache.derbyTesting.functionTests.tests.store.OnlineBackupTest3$A
        syncStatementThread.run(OnlineBackupTest3.java:451)
        "Thread-0":
        at org.apache.derby.impl.services.reflect.UpdateLoader.needReload(Update
        Loader.java:304)
      • waiting to lock <0x03022168> (a org.apache.derby.impl.services.reflect
        .UpdateLoader)
        at org.apache.derby.impl.services.reflect.ClassLoaderLock.unlockEvent(Up
        dateLoader.java:362)
        at org.apache.derby.impl.services.locks.Lock.unlock(Lock.java:128)
        at org.apache.derby.impl.services.locks.LockControl.unlock(LockControl.j
        ava:160)
        at org.apache.derby.impl.services.locks.LockSet.unlock(LockSet.java:564)
      • locked <0x03002be8> (a org.apache.derby.impl.services.locks.LockSet)
        at org.apache.derby.impl.services.locks.LockSpace.unlockGroup(LockSpace.
        java:126)
      • locked <0x03153db8> (a org.apache.derby.impl.services.locks.LockSpace)

      at org.apache.derby.impl.services.locks.SinglePool.unlockGroup(SinglePoo
      l.java:306)
      at org.apache.derby.impl.store.raw.xact.Xact.releaseAllLocks(Xact.java:1
      854)
      at org.apache.derby.impl.store.raw.xact.Xact.postComplete(Xact.java:1899
      )
      at org.apache.derby.impl.store.raw.xact.Xact.completeCommit(Xact.java:80
      5)
      at org.apache.derby.impl.store.raw.xact.Xact.commit(Xact.java:847)
      at org.apache.derby.impl.store.raw.xact.Xact.commit(Xact.java:642)
      at org.apache.derby.impl.store.access.RAMTransaction.commit(RAMTransacti
      on.java:1953)
      at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.doCom
      mit(GenericLanguageConnectionContext.java:1105)
      at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.userC
      ommit(GenericLanguageConnectionContext.java:935)
      at org.apache.derby.impl.jdbc.TransactionResourceImpl.commit(Transaction
      ResourceImpl.java:237)
      at org.apache.derby.impl.jdbc.EmbedConnection.commit(EmbedConnection.jav
      a:862)

      • locked <0x031413b0> (a org.apache.derby.impl.jdbc.EmbedConnection30)
        at org.apache.derbyTesting.functionTests.tests.store.OnlineBackupTest3.i
        nstallJarTest(OnlineBackupTest3.java:227)
        at org.apache.derbyTesting.functionTests.tests.store.OnlineBackupTest3.r
        unTest(OnlineBackupTest3.java:90)
        at org.apache.derbyTesting.functionTests.tests.store.OnlineBackupTest3.m
        ain(OnlineBackupTest3.java:49)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
        java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
        sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.derbyTesting.functionTests.harness.RunClass.run(RunClass.j
        ava:50)
      • locked <0x02fe5b78> (a org.apache.derbyTesting.functionTests.harness.R
        unClass)
        at java.lang.Thread.run(Thread.java:595)

      Found 1 deadlock.

      Note : Found this issue while doing online backup testing, , but it does not look like online backup related,.

      Scenario:

      — one thread (Thread 0) is committing a transaction with a install jar operation in it.
      — another thread (Thread 1) is attempting to add a jar

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Suresh Thalamati
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development