looneyapurv / jain-sip

Automatically exported from code.google.com/p/jain-sip
0 stars 0 forks source link

RoundRobinLoadBalancerElector is not thread safe #124

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Configure JainSlee SIP-RA with two SIPLDB nodes, wheras one should be 
unavailable
2. Send a reasonable Number of CPS to the system using any SIP Testservice

What is the expected output? What do you see instead?
1. Expected: All Calls should be routed to the active LDB
2. Real: Sporadically Calls are routed to the inactive LDB

What version of the product are you using? On what operating system?
2.7.0 JainSlee Release - which is using Jain-SIP-HA 1.3.0

Please provide any additional information below.
The issue was already posted in mobicents-public on 2013/08/06

Solution:
The selection of the unavailable LDB-Node can be tracked down to 
RoundRobinLoadBalancerElector. Under a significant number of parallel Threads 
getNextIndex() may repeatedly return one and the same unavailable Node Index.

Attached RoundRobinAvailableLoadBalancerElector avoids this by checking 
availablity already in getNextIndex() method. RoundRobinLoadBalancerElectorTest 
(adoption of original Testclass from jain-sip-jboss5 project) also attached.

It has to be decided if RoundRobinAvailableLoadBalancerElector will replace 
RoundRobinLoadBalancerElector, or if it will exist as parallel implementation 
(Elector-Implementation can be configured within SIP-RA anyway)

Original issue reported on code.google.com by stephan....@kapsch.net on 16 Sep 2013 at 7:29

Attachments: