[jboss-jira] [JBoss JIRA] Resolved: (JGRP-447) Non-thread-safe access to FC.creditors

Bela Ban (JIRA) jira-events at lists.jboss.org
Fri Mar 30 10:45:18 EDT 2007


     [ http://jira.jboss.com/jira/browse/JGRP-447?page=all ]

Bela Ban resolved JGRP-447.
---------------------------

    Resolution: Done

Fixed by copying creditors inside of lock. Not executed a lot so copying has no perf impact

> Non-thread-safe access to FC.creditors
> --------------------------------------
>
>                 Key: JGRP-447
>                 URL: http://jira.jboss.com/jira/browse/JGRP-447
>             Project: JGroups
>          Issue Type: Bug
>    Affects Versions: 2.4.1 SP1
>            Reporter: Brian Stansberry
>         Assigned To: Bela Ban
>             Fix For: 2.4.1 SP2
>
>
> During load testing of AS HttpSession repl, QE saw RPC transmission errors with the following root cause:
> [JBoss] Caused by: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
> [JBoss] at java.util.ArrayList.RangeCheck(ArrayList.java:546)
> [JBoss] at java.util.ArrayList.get(ArrayList.java:321)
> [JBoss] at org.jgroups.protocols.FC.handleDownMessage(FC.java:390)
> [JBoss] at org.jgroups.protocols.FC.down(FC.java:320)
> [JBoss] at org.jgroups.stack.Protocol.receiveDownEvent(Protocol.java:517)
> [JBoss] at org.jgroups.protocols.FC.receiveDownEvent(FC.java:314)
> [JBoss] at org.jgroups.stack.Protocol.passDown(Protocol.java:551)
> [JBoss] at org.jgroups.protocols.FRAG2.down(FRAG2.java:167)
> [JBoss] at org.jgroups.stack.Protocol.receiveDownEvent(Protocol.java:517)
> [JBoss] at org.jgroups.stack.Protocol.passDown(Protocol.java:551)
> [JBoss] at org.jgroups.protocols.pbcast.STATE_TRANSFER.down(STATE_TRANSFER.java:294)
> [JBoss] at org.jgroups.stack.Protocol.receiveDownEvent(Protocol.java:517)
> [JBoss] at org.jgroups.stack.ProtocolStack.down(ProtocolStack.java:385)
> [JBoss] at org.jgroups.JChannel.down(JChannel.java:1231)
> [JBoss] at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.down(MessageDispatcher.java:788)
> [JBoss] at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.passDown(MessageDispatcher.java:765)
> [JBoss] at org.jgroups.blocks.RequestCorrelator.sendRequest(RequestCorrelator.java:299)
> [JBoss] at org.jgroups.blocks.GroupRequest.doExecute(GroupRequest.java:444)
> [JBoss] at org.jgroups.blocks.GroupRequest.execute(GroupRequest.java:193)
> [JBoss] at org.jgroups.blocks.MessageDispatcher.castMessage(MessageDispatcher.java:429) 
> Having a look at FC, in handleDownMessage(), where the problem occurred, there's this:
> Util.release(lock);
> try
> {
>    ...
>    for(int i=0; i < creditors.size(); i++) {
>       sendCreditRequest((Address)creditors.get(i));
>   }
> }
> ....
> in handleCredit() there's:
> if(Util.acquire(lock)) {
>    ...
>    if(creditors.size() > 0) {  // we are blocked because we expect credit from one or more members
>       creditors.remove(sender);
>       ...
>    }
>    ...
> }
> If the creditors.remove(sender) call is invoked while the handleDownMessage for loop is looping, there's a possibility of IndexOutOfBoundsException.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list