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

Make embedded Derby work reliably in the presence of thread interrupts

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.2.1.6, 10.2.2.0, 10.3.1.4, 10.3.2.1, 10.3.3.0, 10.4.1.3, 10.4.2.0, 10.5.1.1, 10.5.2.0, 10.5.3.0, 10.6.1.0
    • 10.8.1.2
    • Store
    • Normal
    • Regression

    Description

      When not executing on a small device VM, Derby has been using the Java NIO classes java.nio.clannel.* for file io for extra concurrency.
      If a thread is interrupted while executing blocking IO operations in NIO, the ClosedByInterruptException will get thrown. Unfortunately, Derby isn't current architected to retry and complete such operations (before passing on the interrupt), so the Derby database store can be left in an inconsistent state, although no data is corrupted, and we therefore have to return a database level error to perform shutdown and recovery. This means the applications can no longer access the database while a shutdown and reboot including a recovery is taking place.

      It would be nice if Derby could somehow detect and finish IO operations underway when thread interrupts happen before passing the exception on to the application. Derby embedded is sometimes embedded in applications that use Thread.interrupt to stop threads.

      Attachments

        1. derby.log
          4 kB
          Lily Wei
        2. derby.log
          27 kB
          Lily Wei
        3. derby-4741-a-01-api-interruptstatus.diff
          39 kB
          Dag H. Wanvik
        4. derby-4741-a-01-api-interruptstatus.stat
          0.7 kB
          Dag H. Wanvik
        5. derby-4741-a-02-api-interruptstatus.diff
          45 kB
          Dag H. Wanvik
        6. derby-4741-a-02-api-interruptstatus.stat
          1.0 kB
          Dag H. Wanvik
        7. derby-4741-a-03-api-interruptstatus.diff
          44 kB
          Dag H. Wanvik
        8. derby-4741-a-03-api-interruptstatus.stat
          1.0 kB
          Dag H. Wanvik
        9. derby-4741-a-04-api-interruptstatus.diff
          43 kB
          Dag H. Wanvik
        10. derby-4741-a-04-api-interruptstatus.stat
          1.0 kB
          Dag H. Wanvik
        11. derby-4741-all+lenient+resurrect.diff
          116 kB
          Dag H. Wanvik
        12. derby-4741-all+lenient+resurrect.stat
          2 kB
          Dag H. Wanvik
        13. derby-4741-b-01-nio.diff
          61 kB
          Dag H. Wanvik
        14. derby-4741-b-01-nio.stat
          0.7 kB
          Dag H. Wanvik
        15. derby-4741-b-02-nio.diff
          61 kB
          Dag H. Wanvik
        16. derby-4741-b-02-nio.stat
          0.6 kB
          Dag H. Wanvik
        17. derby-4741-b-03-nio.diff
          63 kB
          Dag H. Wanvik
        18. derby-4741-b-03-nio.stat
          0.6 kB
          Dag H. Wanvik
        19. derby-4741-b-04-nio.diff
          65 kB
          Dag H. Wanvik
        20. derby-4741-b-04-nio.stat
          0.6 kB
          Dag H. Wanvik
        21. derby-4741-c-01-nio.diff
          7 kB
          Dag H. Wanvik
        22. derby-4741-c-01-nio.stat
          0.1 kB
          Dag H. Wanvik
        23. derby-4741-fix-compilation.diff
          2 kB
          Dag H. Wanvik
        24. derby-4741-fix-compilation.stat
          0.2 kB
          Dag H. Wanvik
        25. derby-4741-kristians-01.diff
          4 kB
          Dag H. Wanvik
        26. derby-4741-nio-container+log.diff
          59 kB
          Dag H. Wanvik
        27. derby-4741-nio-container+log.stat
          0.8 kB
          Dag H. Wanvik
        28. derby-4741-nio-container+log+waits.diff
          63 kB
          Dag H. Wanvik
        29. derby-4741-nio-container+log+waits.stat
          0.8 kB
          Dag H. Wanvik
        30. derby-4741-nio-container+log+waits+locks.diff
          73 kB
          Dag H. Wanvik
        31. derby-4741-nio-container+log+waits+locks.stat
          1 kB
          Dag H. Wanvik
        32. derby-4741-nio-container+log+waits+locks+throws.diff
          100 kB
          Dag H. Wanvik
        33. derby-4741-nio-container+log+waits+locks+throws.stat
          2 kB
          Dag H. Wanvik
        34. derby-4741-nio-container+log+waits+locks-2.diff
          80 kB
          Dag H. Wanvik
        35. derby-4741-nio-container+log+waits+locks-2.stat
          1 kB
          Dag H. Wanvik
        36. derby-4741-nio-container-2.diff
          25 kB
          Dag H. Wanvik
        37. derby-4741-nio-container-2.log
          55 kB
          Dag H. Wanvik
        38. derby-4741-nio-container-2.stat
          0.4 kB
          Dag H. Wanvik
        39. derby-4741-nio-container-2b.diff
          39 kB
          Dag H. Wanvik
        40. derby-4741-nio-container-2b.stat
          0.4 kB
          Dag H. Wanvik
        41. derby-4741-raf-stresstest-1.diff
          17 kB
          Dag H. Wanvik
        42. derby-4741-raf-stresstest-1.stat
          0.2 kB
          Dag H. Wanvik
        43. derby-4741-raf-stresstest-2.diff
          17 kB
          Dag H. Wanvik
        44. derby-4741-raf-stresstest-2.stat
          0.2 kB
          Dag H. Wanvik
        45. derby-4741-raf-stresstest-3.diff
          20 kB
          Dag H. Wanvik
        46. derby-4741-raf-stresstest-3.stat
          0.2 kB
          Dag H. Wanvik
        47. derby-4741-raf-stresstest-4.diff
          23 kB
          Dag H. Wanvik
        48. derby-4741-raf-stresstest-4.stat
          0.4 kB
          Dag H. Wanvik
        49. derby-4741-sleeps-waits-1.diff
          5 kB
          Dag H. Wanvik
        50. derby-4741-sleeps-waits-1.stat
          0.2 kB
          Dag H. Wanvik
        51. derby-4741-sleeps-waits-2.diff
          19 kB
          Dag H. Wanvik
        52. derby-4741-sleeps-waits-2.stat
          0.8 kB
          Dag H. Wanvik
        53. derby-4741-sleeps-waits-3.diff
          19 kB
          Dag H. Wanvik
        54. derby-4741-sleeps-waits-3.stat
          0.8 kB
          Dag H. Wanvik
        55. derby-4741-sleeps-waits-more.diff
          8 kB
          Dag H. Wanvik
        56. derby-4741-sleeps-waits-more.stat
          0.5 kB
          Dag H. Wanvik
        57. derby-4741-testBatchInterrupt.diff
          10 kB
          Dag H. Wanvik
        58. derby-4741-testBatchInterrupt-b.diff
          3 kB
          Dag H. Wanvik
        59. derby-4741-testQueryInterrupt.diff
          8 kB
          Dag H. Wanvik
        60. derby-4741-testQueryInterrupt.stat
          0.2 kB
          Dag H. Wanvik
        61. InterruptResilienceTest.java
          9 kB
          Lily Wei
        62. interrupts-fs.html
          8 kB
          Dag H. Wanvik
        63. interrupts-fs.html
          8 kB
          Dag H. Wanvik
        64. interrupts-fs.html
          7 kB
          Dag H. Wanvik
        65. interrupts-fs.html
          6 kB
          Dag H. Wanvik
        66. MicroAPITest.java
          2 kB
          Dag H. Wanvik
        67. sleep-1-usages.txt
          2 kB
          Dag H. Wanvik
        68. wait-0-usages.txt
          5 kB
          Dag H. Wanvik
        69. wait-1-usages.txt
          1 kB
          Dag H. Wanvik
        70. xsbt0.log.gz
          23 kB
          Dag H. Wanvik

        Issue Links

          Activity

            People

              dagw Dag H. Wanvik
              dagw Dag H. Wanvik
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: