Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-5568

KeyAffinityService race condition on view change

    XMLWordPrintable

    Description

    KeyAffinityService#getKeyForAddress runs in a tight loop looking for keys:

        queue = address2key.get(address)
        while (result == null)
            result = queue.poll()
    

    KeyAffinityService#handleViewChange clears and resets the queue list on membership change:

        address2key.clear()
        for each address
            map.put(address, new queue)
    

    If a view change comes in after getKeyForAddress gets the queue, and the queue is empty, it will get stuck in a tight loop looking at the wrong queue forever while new keys are added to the new queue.

      Gliffy Diagrams

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                baranowb Bartosz Baranowski
                Reporter:
                dereed Dennis Reed
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: