Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-5405

Java deadlock in AutomaticIndexStatisticsTest.testShutdownWhileScanningThenDelete (BasePage and StoredPage)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 10.9.1.0
    • None
    • Services, Store
    • Linux 2.6.38.8-32.fc15.x86_64, OpenJDK Runtime Environment (IcedTea6 1.10.2) (fedora-58.1.10.2.fc15-x86_64)
    • Urgent
    • High Value Fix
    • Regression

    Description

      Observed this deadlock when running suites.All.

      Found one Java-level deadlock:
      =============================
      "index-stat-thread":
      waiting to lock monitor 0x00007f8294076928 (object 0x00000000ff73da10, a org.apache.derby.impl.store.raw.data.BaseContainerHandle),
      which is held by "main"
      "main":
      waiting to lock monitor 0x00007f82cc4b4f28 (object 0x00000000f57a3798, a org.apache.derby.impl.store.raw.data.StoredPage),
      which is held by "index-stat-thread"

      Java stack information for the threads listed above:
      ===================================================
      "index-stat-thread":
      at java.util.Observable.deleteObserver(Observable.java:95)

      • waiting to lock <0x00000000ff73da10> (a org.apache.derby.impl.store.raw.data.BaseContainerHandle)
        at org.apache.derby.impl.store.raw.data.BasePage.releaseExclusive(BasePage.java:1819)
      • locked <0x00000000f57a3798> (a org.apache.derby.impl.store.raw.data.StoredPage)
        at org.apache.derby.impl.store.raw.data.CachedPage.releaseExclusive(CachedPage.java:531)
        at org.apache.derby.impl.store.raw.data.StoredPage.releaseExclusive(StoredPage.java:1066)
        at org.apache.derby.impl.store.raw.data.BasePage.unlatch(BasePage.java:1371)
        at org.apache.derby.impl.store.access.btree.ControlRow.release(ControlRow.java:926)
        at org.apache.derby.impl.store.access.btree.BTreeScan.savePositionAndReleasePage(BTreeScan.java:2146)
        at org.apache.derby.impl.store.access.btree.BTreeForwardScan.fetchRows(BTreeForwardScan.java:442)
        at org.apache.derby.impl.store.access.btree.BTreeScan.fetchNextGroup(BTreeScan.java:1681)
        at org.apache.derby.impl.services.daemon.IndexStatisticsDaemonImpl$KeyComparator.fetchRows(IndexStatisticsDaemonImpl.java:1221)
        at org.apache.derby.impl.services.daemon.IndexStatisticsDaemonImpl.updateIndexStatsMinion(IndexStatisticsDaemonImpl.java:463)
        at org.apache.derby.impl.services.daemon.IndexStatisticsDaemonImpl.generateStatistics(IndexStatisticsDaemonImpl.java:323)
        at org.apache.derby.impl.services.daemon.IndexStatisticsDaemonImpl.processingLoop(IndexStatisticsDaemonImpl.java:794)
        at org.apache.derby.impl.services.daemon.IndexStatisticsDaemonImpl.run(IndexStatisticsDaemonImpl.java:710)
        at java.lang.Thread.run(Thread.java:679)
        "main":
        at org.apache.derby.impl.store.raw.data.BasePage.isLatched(BasePage.java:1383)
      • waiting to lock <0x00000000f57a3798> (a org.apache.derby.impl.store.raw.data.StoredPage)
        at org.apache.derby.impl.store.raw.data.BasePage.update(BasePage.java:1621)
        at java.util.Observable.notifyObservers(Observable.java:159)
        at java.util.Observable.notifyObservers(Observable.java:115)
        at org.apache.derby.impl.store.raw.data.BaseContainerHandle.informObservers(BaseContainerHandle.java:1008)
        at org.apache.derby.impl.store.raw.data.BaseContainerHandle.close(BaseContainerHandle.java:414)
      • locked <0x00000000ff73da10> (a org.apache.derby.impl.store.raw.data.BaseContainerHandle)
        at org.apache.derby.impl.store.access.btree.OpenBTree.close(OpenBTree.java:495)
        at org.apache.derby.impl.store.access.btree.BTreeScan.closeForEndTransaction(BTreeScan.java:2021)
        at org.apache.derby.impl.store.access.btree.index.B2IForwardScan.closeForEndTransaction(B2IForwardScan.java:107)
        at org.apache.derby.impl.store.access.RAMTransaction.closeControllers(RAMTransaction.java:245)
        at org.apache.derby.impl.store.access.RAMTransactionContext.cleanupOnError(RAMTransactionContext.java:97)
        at org.apache.derby.iapi.services.context.ContextManager.cleanupOnError(ContextManager.java:343)
        at org.apache.derby.impl.services.daemon.IndexStatisticsDaemonImpl.stop(IndexStatisticsDaemonImpl.java:919)
      • locked <0x00000000ff764de8> (a java.util.ArrayList)
        at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.disableIndexStatsRefresher(DataDictionaryImpl.java:13891)
        at org.apache.derby.impl.db.DatabaseContextImpl.cleanupOnError(DatabaseContextImpl.java:69)
        at org.apache.derby.iapi.services.context.ContextManager.cleanupOnError(ContextManager.java:343)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.cleanupOnError(TransactionResourceImpl.java:437)
        at org.apache.derby.impl.jdbc.EmbedConnection.<init>(EmbedConnection.java:633)
        at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(EmbedConnection30.java:73)
        at org.apache.derby.impl.jdbc.EmbedConnection40.<init>(EmbedConnection40.java:51)
        at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Driver40.java:70)
        at org.apache.derby.jdbc.InternalDriver.connect(InternalDriver.java:248)
        at org.apache.derby.jdbc.EmbeddedDataSource.getConnection(EmbeddedDataSource.java:480)
        at org.apache.derby.jdbc.EmbeddedDataSource.getConnection(EmbeddedDataSource.java:424)
        at org.apache.derbyTesting.junit.JDBCDataSource.shutdownDatabase(JDBCDataSource.java:266)
        at org.apache.derbyTesting.functionTests.tests.store.AutomaticIndexStatisticsTest.testShutdownWhileScanningThenDelete(AutomaticIndexStatisticsTest.java:187)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at junit.framework.TestCase.runTest(TestCase.java:164)
        at junit.framework.TestCase.runBare(TestCase.java:130)
        at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:113)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:120)
        at junit.framework.TestSuite.runTest(TestSuite.java:230)
        at junit.framework.TestSuite.run(TestSuite.java:225)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.extensions.TestSetup.run(TestSetup.java:25)
        at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.extensions.TestSetup.run(TestSetup.java:25)
        at junit.framework.TestSuite.runTest(TestSuite.java:230)
        at junit.framework.TestSuite.run(TestSuite.java:225)
        at kah.TestRunner.main(TestRunner.java:77)

      Found 1 deadlock.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              kristwaa Kristian Waagan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: