Lucene - Core
  1. Lucene - Core
  2. LUCENE-3150

Wherever we catch & suppress Throwable we should not suppress ThreadInterruptedException

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 4.9, Trunk
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      In various places we catch Throwable and suppress it, usually in exception handlers where we want to just throw the first exc we had hit.

      But this is dangerous for a thread interrupt since it means we can swallow & ignore the interrupt.

      We should at least catch the interrupt & restore the interrupt bit, if we can't rethrow it.

      One example is in SegmentInfos where we write the segments.gen file... there are many other examples in SegmentInfos too.

      1. LUCENE-3150.patch
        17 kB
        Simon Willnauer

        Activity

        Uwe Schindler made changes -
        Fix Version/s 4.9 [ 12326730 ]
        Fix Version/s 5.0 [ 12321663 ]
        Fix Version/s 4.8 [ 12326269 ]
        Hide
        Uwe Schindler added a comment -

        Move issue to Lucene 4.9.

        Show
        Uwe Schindler added a comment - Move issue to Lucene 4.9.
        David Smiley made changes -
        Fix Version/s 4.8 [ 12326269 ]
        Fix Version/s 4.7 [ 12325572 ]
        Simon Willnauer made changes -
        Fix Version/s 4.7 [ 12325572 ]
        Fix Version/s 4.6 [ 12324999 ]
        Adrien Grand made changes -
        Fix Version/s 4.6 [ 12324999 ]
        Fix Version/s 5.0 [ 12321663 ]
        Fix Version/s 4.5 [ 12324742 ]
        Steve Rowe made changes -
        Fix Version/s 5.0 [ 12321663 ]
        Fix Version/s 4.5 [ 12324742 ]
        Fix Version/s 4.4 [ 12324323 ]
        Hide
        Steve Rowe added a comment -

        Bulk move 4.4 issues to 4.5 and 5.0

        Show
        Steve Rowe added a comment - Bulk move 4.4 issues to 4.5 and 5.0
        Uwe Schindler made changes -
        Fix Version/s 4.4 [ 12324323 ]
        Fix Version/s 4.3 [ 12324143 ]
        Robert Muir made changes -
        Fix Version/s 4.3 [ 12324143 ]
        Fix Version/s 5.0 [ 12321663 ]
        Fix Version/s 4.2 [ 12323899 ]
        Mark Miller made changes -
        Fix Version/s 4.2 [ 12323899 ]
        Fix Version/s 4.1 [ 12321140 ]
        Mark Miller made changes -
        Fix Version/s 5.0 [ 12321663 ]
        Robert Muir made changes -
        Fix Version/s 4.1 [ 12321140 ]
        Fix Version/s 4.0 [ 12314025 ]
        Hoss Man made changes -
        Fix Version/s 3.6 [ 12319070 ]
        Hide
        Hoss Man added a comment -

        Bulk changing fixVersion 3.6 to 4.0 for any open issues that are unassigned and have not been updated since March 19.

        Email spam suppressed for this bulk edit; search for hoss20120323nofix36 to identify all issues edited

        Show
        Hoss Man added a comment - Bulk changing fixVersion 3.6 to 4.0 for any open issues that are unassigned and have not been updated since March 19. Email spam suppressed for this bulk edit; search for hoss20120323nofix36 to identify all issues edited
        Simon Willnauer made changes -
        Fix Version/s 3.6 [ 12319070 ]
        Fix Version/s 3.5 [ 12317877 ]
        Simon Willnauer made changes -
        Attachment LUCENE-3150.patch [ 12503531 ]
        Hide
        Simon Willnauer added a comment -

        here is a first patch for this issue. I integrated another utility into IOUtils that checks if we suppress an InterruptException and resets the interrupt bit on the thread if so. I also call maybeResetInterrupt throughout the code in core where we catch(Throwable) and don't rethrow - its a start....

        Show
        Simon Willnauer added a comment - here is a first patch for this issue. I integrated another utility into IOUtils that checks if we suppress an InterruptException and resets the interrupt bit on the thread if so. I also call maybeResetInterrupt throughout the code in core where we catch(Throwable) and don't rethrow - its a start....
        Michael McCandless made changes -
        Fix Version/s 3.5 [ 12317877 ]
        Fix Version/s 3.4 [ 12316675 ]
        Robert Muir made changes -
        Field Original Value New Value
        Fix Version/s 3.4 [ 12316675 ]
        Fix Version/s 3.3 [ 12316470 ]
        Hide
        Shai Erera added a comment -

        We can fix IOUtils to do that – now that we call it from many places in the code, it will catch a lot of instances. Also, perhaps we could have an Abortable interface and then call IOUtils from all places that impl abort() today.

        Show
        Shai Erera added a comment - We can fix IOUtils to do that – now that we call it from many places in the code, it will catch a lot of instances. Also, perhaps we could have an Abortable interface and then call IOUtils from all places that impl abort() today.
        Michael McCandless created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Michael McCandless
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development