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, 5.0
    • 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

        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.
        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....
        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
        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
        Hide
        Uwe Schindler added a comment -

        Move issue to Lucene 4.9.

        Show
        Uwe Schindler added a comment - Move issue to Lucene 4.9.

          People

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

            Dates

            • Created:
              Updated:

              Development