Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-978

GC resources in TermInfosReader when exception occurs in its constructor

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3
    • Component/s: core/index
    • Labels:
      None
    • Lucene Fields:
      Patch Available

      Description

      I replaced IndexModifier with IndexWriter in test case TestStressIndexing and noticed the test failed from time to time because some .tis file is still open when MockRAMDirectory.close() is called. It turns out it is because .tis file is not closed if an exception occurs in TermInfosReader's constructor.

      1. Readers.patch
        7 kB
        Ning Li
      2. TermInfosReader.patch
        2 kB
        Ning Li

        Activity

        Hide
        yseeley@gmail.com Yonik Seeley added a comment -

        Nice catch! fix looks good to me.

        Show
        yseeley@gmail.com Yonik Seeley added a comment - Nice catch! fix looks good to me.
        Hide
        mikemccand Michael McCandless added a comment -

        Agreed. Actually, it also looks like we need to do something similar for FieldsReader/TermVectorsReader too?

        Show
        mikemccand Michael McCandless added a comment - Agreed. Actually, it also looks like we need to do something similar for FieldsReader/TermVectorsReader too?
        Hide
        ningli Ning Li added a comment -

        > Agreed. Actually, it also looks like we need to do something similar for FieldsReader/TermVectorsReader too?

        That's right. I'll submit a new patch.

        Show
        ningli Ning Li added a comment - > Agreed. Actually, it also looks like we need to do something similar for FieldsReader/TermVectorsReader too? That's right. I'll submit a new patch.
        Hide
        ningli Ning Li added a comment -

        Similar fixes are added for FieldsReader and TermVectorsReader as well.

        Show
        ningli Ning Li added a comment - Similar fixes are added for FieldsReader and TermVectorsReader as well.
        Hide
        mikemccand Michael McCandless added a comment -

        This looks good Ning, thanks! I will commit...

        Show
        mikemccand Michael McCandless added a comment - This looks good Ning, thanks! I will commit...
        Hide
        mikemccand Michael McCandless added a comment -

        I just committed this.

        Show
        mikemccand Michael McCandless added a comment - I just committed this.

          People

          • Assignee:
            mikemccand Michael McCandless
            Reporter:
            ningli Ning Li
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development