Lucene - Core
  1. Lucene - Core
  2. LUCENE-3484

TaxonomyWriter parents array creation is not thread safe, can cause NPE

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.5, 4.0-ALPHA
    • Component/s: modules/facet
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      Following user list thread TaxWriter leakage? it appears that if two threads or more are asking for the parent array for the first time, a context switch after the first thread created the empty parents array but before it initialized it would cause the other array to use an uninitialized array, causing an NPE. Fix is simple: synchronize the method getParentArray()

        Activity

        Hide
        Uwe Schindler added a comment -

        Bulk close after release of 3.5

        Show
        Uwe Schindler added a comment - Bulk close after release of 3.5
        Hide
        Doron Cohen added a comment -

        Great, thanks Mihai for verifying this!

        Show
        Doron Cohen added a comment - Great, thanks Mihai for verifying this!
        Hide
        Mihai Caraman added a comment - - edited

        So only the synch has changed, without those two if's... I'm checking it now

        L.E. : works! thank you

        Show
        Mihai Caraman added a comment - - edited So only the synch has changed, without those two if's... I'm checking it now L.E. : works! thank you
        Hide
        Doron Cohen added a comment -

        Fixed:

        • r1178923, r1178936 - trunk
        • r1178931 - 3x
        Show
        Doron Cohen added a comment - Fixed: r1178923, r1178936 - trunk r1178931 - 3x
        Hide
        Doron Cohen added a comment -

        Patch with test that fails same as the reported error.

        None of the changes here should be committed, just showing the error.

        Show
        Doron Cohen added a comment - Patch with test that fails same as the reported error. None of the changes here should be committed, just showing the error.

          People

          • Assignee:
            Doron Cohen
            Reporter:
            Doron Cohen
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development