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-5333-repro.diff
        0.7 kB
        Dag H. Wanvik
      2. derby-5333a.diff
        0.9 kB
        Dag H. Wanvik

        Issue Links

          Activity

          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.
          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 -

          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 -

          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.
          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.
          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
          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 -

          Backported to 10.8 branch at 1151118, closing.

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

            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