Lucene - Core
  1. Lucene - Core
  2. LUCENE-2273

FieldCacheImpl's getCacheEntries() is buggy as it uses WeakHashMap incorrectly and leads to ConcurrentModExceptions

    Details

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

      Description

      The way how WeakHashMap works internally leads to the fact that it is not allowed to iterate over a WHM.keySet() and then get() the value. As each get() operation inspects the ReferenceQueue of the weak keys, they may suddenly disappear. If you use the entrySet() iterator you get key and value and no need to call get(), contains(),... that inspects the ReferenceQueue.

      1. LUCENE-2273.patch
        2 kB
        Uwe Schindler

        Activity

        Hide
        Michael McCandless added a comment -

        Can we add @lucene.internal to this API as well? Or lucene.experimental?

        Show
        Michael McCandless added a comment - Can we add @lucene.internal to this API as well? Or lucene.experimental?
        Hide
        Uwe Schindler added a comment -

        Its already marked as experimental in the interface

        Show
        Uwe Schindler added a comment - Its already marked as experimental in the interface
        Hide
        Uwe Schindler added a comment -

        Here the fix, will commit this soon.

        Show
        Uwe Schindler added a comment - Here the fix, will commit this soon.
        Hide
        Uwe Schindler added a comment -

        Committed revision: 912330

        Show
        Uwe Schindler added a comment - Committed revision: 912330
        Hide
        Uwe Schindler added a comment -

        I added one more null check on the weak key of the cache in rev 912331

        Show
        Uwe Schindler added a comment - I added one more null check on the weak key of the cache in rev 912331

          People

          • Assignee:
            Uwe Schindler
            Reporter:
            Uwe Schindler
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development