Derby
  1. Derby
  2. DERBY-5333

Intermittent assert failure in testInterruptShutdown: thread's interrupted flag lost after shutdown

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 10.8.2.2, 10.9.1.0
    • Component/s: JDBC
    • Labels:
      None

      Description

      Saw this while running trunk's InterruptResilienceTest 800 times back-to-back with JDK1.7 b147 looking for DERBY-5312. It is independent of that issue, though: I saw it with both proposed patches for that issue also.

      1) testInterruptShutdown(org.apache.derbyTesting.functionTests.tests.store.InterruptResilienceTest)junit.f\
      ramework.AssertionFailedError
      at org.apache.derbyTesting.functionTests.tests.store.InterruptResilienceTest.testInterruptShutdown\
      (InterruptResilienceTest.java:667)
      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:112)
      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 junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)

      1. derby-5333a.diff
        0.9 kB
        Dag H. Wanvik
      2. derby-5333-repro.diff
        0.7 kB
        Dag H. Wanvik

        Issue Links

          Activity

          Gavin made changes -
          Workflow jira [ 12620393 ] Default workflow, editable Closed status [ 12797109 ]
          Knut Anders Hatlen made changes -
          Link This issue is duplicated by DERBY-5175 [ DERBY-5175 ]
          Myrna van Lunteren made changes -
          Fix Version/s 10.8.2.2 [ 12317968 ]
          Fix Version/s 10.8.2.0 [ 12317955 ]
          Myrna van Lunteren made changes -
          Fix Version/s 10.8.2.0 [ 12317955 ]
          Fix Version/s 10.8.1.6 [ 12316676 ]
          Dag H. Wanvik made changes -
          Link This issue is part of DERBY-4741 [ DERBY-4741 ]
          Dag H. Wanvik made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Dag H. Wanvik made changes -
          Fix Version/s 10.8.1.6 [ 12316676 ]
          Fix Version/s 10.9.0.0 [ 12316344 ]
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Resolved [ 5 ]
          Issue & fix info [Patch Available]
          Hide
          Dag H. Wanvik added a comment -

          Backported to 10.8 branch at 1151118, closing.

          Show
          Dag H. Wanvik added a comment - Backported to 10.8 branch at 1151118, closing.
          Hide
          Dag H. Wanvik added a comment -

          Committed patch derby-5333a at svn 1151101.

          Show
          Dag H. Wanvik added a comment - Committed patch derby-5333a at svn 1151101.
          Hide
          Dag H. Wanvik added a comment -

          Regressions ran ok, modulo errors in LobLimitsTest, which I believe are unrelated.

          Show
          Dag H. Wanvik added a comment - Regressions ran ok, modulo errors in LobLimitsTest, which I believe are unrelated.
          Hide
          Knut Anders Hatlen added a comment -

          The patch looks correct to me. +1 to commit.

          Show
          Knut Anders Hatlen added a comment - The patch looks correct to me. +1 to commit.
          Dag H. Wanvik made changes -
          Attachment derby-5333a.diff [ 12487097 ]
          Dag H. Wanvik made changes -
          Attachment derby-5333a.diff [ 12487096 ]
          Dag H. Wanvik made changes -
          Issue & fix info [Patch Available]
          Dag H. Wanvik made changes -
          Attachment derby-5333a.diff [ 12487096 ]
          Hide
          Dag H. Wanvik added a comment -

          Uploading a patch which fixes this issue. There was a remaining case of wait() being called by the session thread in the BasicDaemon code which led to the interrupt flag being lost. This would only happen if the checkpoint was still active when the session thread tried to stop the daemon, hence the sleep in the repro pushed it out in time to make it more likely.

          Show
          Dag H. Wanvik added a comment - Uploading a patch which fixes this issue. There was a remaining case of wait() being called by the session thread in the BasicDaemon code which led to the interrupt flag being lost. This would only happen if the checkpoint was still active when the session thread tried to stop the daemon, hence the sleep in the repro pushed it out in time to make it more likely.
          Dag H. Wanvik made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Dag H. Wanvik made changes -
          Assignee Dag H. Wanvik [ dagw ]
          Dag H. Wanvik made changes -
          Attachment derby-5333-repro.diff [ 12487048 ]
          Hide
          Dag H. Wanvik added a comment -

          Uploading a patch (derby-5333-repro) which when applied provokes the error on my box reliably. It makes the daemon checkpointing wait 15 seconds before proceeding. It happens on JDK 5/6, too, not only JDK 7.

          Show
          Dag H. Wanvik added a comment - Uploading a patch (derby-5333-repro) which when applied provokes the error on my box reliably. It makes the daemon checkpointing wait 15 seconds before proceeding. It happens on JDK 5/6, too, not only JDK 7.
          Hide
          Dag H. Wanvik added a comment -

          I was able to see this in the debugger by holding back the background daemon doing checkpointing a bit, so there is a bug here.

          Show
          Dag H. Wanvik added a comment - I was able to see this in the debugger by holding back the background daemon doing checkpointing a bit, so there is a bug here.
          Hide
          Dag H. Wanvik added a comment -

          Data point: I did not see this when running 2000 iterations with patches for DERBY-5312 and DERBY-5325, but it could be just timing changes, too early to say.

          Show
          Dag H. Wanvik added a comment - Data point: I did not see this when running 2000 iterations with patches for DERBY-5312 and DERBY-5325 , but it could be just timing changes, too early to say.
          Dag H. Wanvik made changes -
          Field Original Value New Value
          Description Saw this while running InterruptResilienceTest 800 times back-to-back with JDK1.7 b147 looking foir DERBY-5312.

          1) testInterruptShutdown(org.apache.derbyTesting.functionTests.tests.store.InterruptResilienceTest)junit.f\
          ramework.AssertionFailedError
                  at org.apache.derbyTesting.functionTests.tests.store.InterruptResilienceTest.testInterruptShutdown\
          (InterruptResilienceTest.java:667)
                  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:112)
                  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 junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
                  at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
                  at junit.extensions.TestSetup.run(TestSetup.java:25)

          Saw this while running trunk's InterruptResilienceTest 800 times back-to-back with JDK1.7 b147 looking for DERBY-5312. It is independent of that issue, though: I saw it with both proposed patches for that issue also.

          1) testInterruptShutdown(org.apache.derbyTesting.functionTests.tests.store.InterruptResilienceTest)junit.f\
          ramework.AssertionFailedError
                  at org.apache.derbyTesting.functionTests.tests.store.InterruptResilienceTest.testInterruptShutdown\
          (InterruptResilienceTest.java:667)
                  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:112)
                  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 junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
                  at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
                  at junit.extensions.TestSetup.run(TestSetup.java:25)

          Dag H. Wanvik created issue -

            People

            • Assignee:
              Dag H. Wanvik
              Reporter:
              Dag H. Wanvik
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development