Bug 1233968

Summary: [GSS](6.4.z) KeyAffinityService race condition on view change
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: dereed
Component: ClusteringAssignee: baranowb <bbaranow>
Status: CLOSED CURRENTRELEASE QA Contact: Jitka Kozana <jkudrnac>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: aogburn, bbaranow, bmaxwell, istraka, istudens, mpark, paul.ferraro, rachmato, rsvoboda
Target Milestone: CR1   
Target Release: EAP 6.4.4   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-01-17 10:53:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1202355, 1235526, 1235744, 1246934    
Attachments:
Description Flags
Test case none

Description dereed 2015-06-19 21:07:42 UTC
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.

This affects EAP 6 session clustering with <distributed-cache>.

Comment 6 dereed 2015-07-27 04:03:25 UTC
Created attachment 1056437 [details]
Test case

Comment 7 Ivan Straka 2015-09-24 11:25:59 UTC
The test case run for about 10minutes and did not stop counting in contrast to old version: test case failed almost immediately with EAP version 6.2.0

Comment 8 JBoss JIRA Server 2015-11-05 13:32:16 UTC
Paul Ferraro <paul.ferraro> updated the status of jira WFLY-4942 to Closed

Comment 9 Richard Achmatowicz 2015-12-15 16:34:29 UTC
Here is the PR for 6.4.4: https://github.com/jbossas/jboss-eap/pull/2661

Comment 10 Richard Achmatowicz 2015-12-15 16:38:34 UTC
Forget the comment above. Wrong issue. If BZ was an real issue management system and not a toy, I could delete the comment - but I can't . Sorry.

Comment 11 Petr Penicka 2017-01-17 10:53:46 UTC
Retroactively bulk-closing issues from released EAP 6.4 cumulative patches.

Comment 12 Petr Penicka 2017-01-17 10:55:28 UTC
Retroactively bulk-closing issues from released EAP 6.4 cumulative patches.