[infinispan-issues] [JBoss JIRA] (ISPN-5568) KeyAffinityService race condition on view change

Dennis Reed (JIRA) issues at jboss.org
Fri Jun 19 17:05:02 EDT 2015


     [ https://issues.jboss.org/browse/ISPN-5568?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dennis Reed updated ISPN-5568:
------------------------------
    Description: 
KeyAffinityService#getKeyForAddress runs in a tight loop looking for keys:
{noformat}
    queue = address2key.get(address)
    while (result == null)
        result = queue.poll()
{noformat}
KeyAffinityService#handleViewChange clears and resets the queue list on membership change:
{noformat}
    address2key.clear()
    for each address
        map.put(address, new queue)
{noformat}
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.

  was:
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.



> KeyAffinityService race condition on view change
> ------------------------------------------------
>
>                 Key: ISPN-5568
>                 URL: https://issues.jboss.org/browse/ISPN-5568
>             Project: Infinispan
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 5.2.11.Final
>            Reporter: Dennis Reed
>
> KeyAffinityService#getKeyForAddress runs in a tight loop looking for keys:
> {noformat}
>     queue = address2key.get(address)
>     while (result == null)
>         result = queue.poll()
> {noformat}
> KeyAffinityService#handleViewChange clears and resets the queue list on membership change:
> {noformat}
>     address2key.clear()
>     for each address
>         map.put(address, new queue)
> {noformat}
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


More information about the infinispan-issues mailing list