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

        Doron Cohen created issue -
        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.
        Doron Cohen made changes -
        Field Original Value New Value
        Attachment LUCENE-3484.patch [ 12497624 ]
        Hide
        Doron Cohen added a comment -

        Fixed:

        • r1178923, r1178936 - trunk
        • r1178931 - 3x
        Show
        Doron Cohen added a comment - Fixed: r1178923, r1178936 - trunk r1178931 - 3x
        Doron Cohen made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 3.5 [ 12317877 ]
        Fix Version/s 4.0 [ 12314025 ]
        Resolution Fixed [ 1 ]
        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 -

        Great, thanks Mihai for verifying this!

        Show
        Doron Cohen added a comment - Great, thanks Mihai for verifying this!
        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
        Uwe Schindler made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        7h 3m 1 Doron Cohen 04/Oct/11 20:59
        Resolved Resolved Closed Closed
        53d 16h 30m 1 Uwe Schindler 27/Nov/11 12:29

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development