Derby
  1. Derby
  2. DERBY-5568

AssertionFailedError: Should not hold locks after commit in ResultSetMiscTest

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.8.2.2
    • Fix Version/s: 10.9.1.0
    • Component/s: Test
    • Labels:
      None
    • Environment:
      Solaris 11 on x86 hardware
      java version "1.7.0_04-ea"
      Java(TM) SE Runtime Environment (build 1.7.0_04-ea-b06)
      Java HotSpot(TM) 64-Bit Server VM (build 23.0-b09, mixed mode)
    • Bug behavior facts:
      Regression Test Failure

      Description

      Saw this failure when running the 10.8.2.2 regression tests on Java 7u4-b06:

      1) testBug4810(org.apache.derbyTesting.functionTests.tests.jdbcapi.ResultSetMiscTest)junit.framework.AssertionFailedError: Should not hold locks after commit
      at org.apache.derbyTesting.functionTests.tests.jdbcapi.ResultSetMiscTest.checkLocksForAutoCommitSelect(ResultSetMiscTest.java:695)
      at org.apache.derbyTesting.functionTests.tests.jdbcapi.ResultSetMiscTest.testBug4810(ResultSetMiscTest.java:478)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:113)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      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.extensions.TestSetup.run(TestSetup.java:25)
      at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)

      1. d5568-1b.diff
        2 kB
        Knut Anders Hatlen
      2. d5568-1a.diff
        2 kB
        Knut Anders Hatlen

        Issue Links

          Activity

          Knut Anders Hatlen created issue -
          Knut Anders Hatlen made changes -
          Field Original Value New Value
          Link This issue is related to DERBY-3258 [ DERBY-3258 ]
          Knut Anders Hatlen made changes -
          Assignee Knut Anders Hatlen [ knutanders ]
          Knut Anders Hatlen made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Hide
          Knut Anders Hatlen added a comment -

          I suspect that this failure has the same root cause as DERBY-3258; that post-commit work happens when the lock table is checked, and extra locks show up because of it.

          The attached patch makes ResultSetMiscTest wait for the post-commit work to complete before it checks the contents of the lock table. This is the same fix as the one applied to ReleaseCompileLocksTest in DERBY-3258.

          Show
          Knut Anders Hatlen added a comment - I suspect that this failure has the same root cause as DERBY-3258 ; that post-commit work happens when the lock table is checked, and extra locks show up because of it. The attached patch makes ResultSetMiscTest wait for the post-commit work to complete before it checks the contents of the lock table. This is the same fix as the one applied to ReleaseCompileLocksTest in DERBY-3258 .
          Knut Anders Hatlen made changes -
          Attachment d5568-1a.diff [ 12509570 ]
          Hide
          Knut Anders Hatlen added a comment -

          Attaching an updated patch that also simplifies the query that fetches the contents of the lock table, and the logic that checks the query result. The query was more complex than it needed to be, probably because it would produce results with nicer formatting back in the days when the test ran as a canon-based ij test. No need for that now that we don't print the results of the query.

          Show
          Knut Anders Hatlen added a comment - Attaching an updated patch that also simplifies the query that fetches the contents of the lock table, and the logic that checks the query result. The query was more complex than it needed to be, probably because it would produce results with nicer formatting back in the days when the test ran as a canon-based ij test. No need for that now that we don't print the results of the query.
          Knut Anders Hatlen made changes -
          Attachment d5568-1b.diff [ 12509576 ]
          Knut Anders Hatlen made changes -
          Issue & fix info Patch Available [ 10102 ]
          Hide
          Dag H. Wanvik added a comment -

          Looks like a good fix and simplification! +1

          Show
          Dag H. Wanvik added a comment - Looks like a good fix and simplification! +1
          Hide
          Knut Anders Hatlen added a comment -

          Thanks, Dag. Committed revision 1229066.

          Show
          Knut Anders Hatlen added a comment - Thanks, Dag. Committed revision 1229066.
          Knut Anders Hatlen made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Issue & fix info Patch Available [ 10102 ]
          Fix Version/s 10.9.0.0 [ 12316344 ]
          Resolution Fixed [ 1 ]
          Knut Anders Hatlen made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Gavin made changes -
          Workflow jira [ 12648065 ] Default workflow, editable Closed status [ 12797034 ]

            People

            • Assignee:
              Knut Anders Hatlen
              Reporter:
              Knut Anders Hatlen
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development