[jboss-jira] [JBoss JIRA] (JGRP-1463) FD_SOCK ArrayIndexOutOfBoundsException

David Hotham (JIRA) jira-events at lists.jboss.org
Mon May 14 06:44:17 EDT 2012


    [ https://issues.jboss.org/browse/JGRP-1463?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12692575#comment-12692575 ] 

David Hotham commented on JGRP-1463:
------------------------------------

I think that, if I've understood it correctly, determinePingDest() just wants to get some member other than the local address.  So it can safely be re-written as:

{noformat}
    private Address determinePingDest() {
        if(local_addr == null)
            return null;

        for(Address tmp: pingable_mbrs) {
            if (!local_addr.equals(tmp)) {
                return tmp;
            }
        }

        return null;
    }
{noformat}

...because the iterator on a CopyOnWriteArrayList is safe to traverse.
                
> FD_SOCK ArrayIndexOutOfBoundsException
> --------------------------------------
>
>                 Key: JGRP-1463
>                 URL: https://issues.jboss.org/browse/JGRP-1463
>             Project: JGroups
>          Issue Type: Bug
>    Affects Versions: 3.0.9, 3.1
>            Reporter: David Hotham
>            Assignee: Bela Ban
>
> Hit this last night while running my usual sort of test: ie members leaving and joining
> {noformat}
> Exception in thread "FD_SOCK pinger,Clumpy Test Cluster,CFS-A-tinkywinky" java.lang.ArrayIndexOutOfBoundsException: 0
>         at java.util.concurrent.CopyOnWriteArrayList.get(CopyOnWriteArrayList.java:368)
>         at java.util.concurrent.CopyOnWriteArrayList.get(CopyOnWriteArrayList.java:377)
>         at org.jgroups.protocols.FD_SOCK.determinePingDest(FD_SOCK.java:783)
>         at org.jgroups.protocols.FD_SOCK.run(FD_SOCK.java:385)
>         at java.lang.Thread.run(Thread.java:722)
> {noformat}
> Presumably there's insufficient synchronization around pingable_mbrs in FD_SOCK.
> Similar to JGRP-1411.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list