[jboss-jira] [JBoss JIRA] (JGRP-1862) NPE during FIND_MBRS when using shared transport

Paul Ferraro (JIRA) issues at jboss.org
Wed Jul 23 16:41:29 EDT 2014


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

Paul Ferraro updated JGRP-1862:
-------------------------------

    Description: 
The following code within org.jgroups.protocols.TP.sendToSingleMember(...) throws an NPE if the transport is shared:

{code}
    Responses responses=(Responses)up(new Event(Event.FIND_MBRS, Arrays.asList(dest)));
    try {
        for(PingData data : responses) {
            if(data.getAddress() != null && data.getAddress().equals(dest)) {
                if((physical_dest=data.getPhysicalAddr()) != null) {
                    sendUnicast(physical_dest, buf, offset, length);
                    return;
                }
            }
        }
    }
    finally {
        responses.done();
    }
{code}

This is because up(Event) always returns null when using a shared transport.
The same issue affects org.jgroups.protocols.TP.fetchPhysicalAddrs(...):
{code}
    if(!missing.isEmpty()) {  // FIND_MBRS either returns immediately or is processed in a separate thread
        Responses rsps=(Responses)up(new Event(Event.FIND_MBRS, missing));
        rsps.done();
    }
{code}

  was:
The following code within org.jgroups.protocols.TP.sendToSingleMember(...) throws an NPE if the transport is shared:

{code}
    Responses responses=(Responses)up(new Event(Event.FIND_MBRS, Arrays.asList(dest)));
    try {
        for(PingData data : responses) {
            if(data.getAddress() != null && data.getAddress().equals(dest)) {
                if((physical_dest=data.getPhysicalAddr()) != null) {
                    sendUnicast(physical_dest, buf, offset, length);
                    return;
                }
            }
        }
    }
    finally {
        responses.done();
    }
{code}

This is because up(Event) always returns null when using a shared transport.



> NPE during FIND_MBRS when using shared transport
> ------------------------------------------------
>
>                 Key: JGRP-1862
>                 URL: https://issues.jboss.org/browse/JGRP-1862
>             Project: JGroups
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 3.5
>            Reporter: Paul Ferraro
>            Assignee: Bela Ban
>            Priority: Blocker
>             Fix For: 3.5
>
>
> The following code within org.jgroups.protocols.TP.sendToSingleMember(...) throws an NPE if the transport is shared:
> {code}
>     Responses responses=(Responses)up(new Event(Event.FIND_MBRS, Arrays.asList(dest)));
>     try {
>         for(PingData data : responses) {
>             if(data.getAddress() != null && data.getAddress().equals(dest)) {
>                 if((physical_dest=data.getPhysicalAddr()) != null) {
>                     sendUnicast(physical_dest, buf, offset, length);
>                     return;
>                 }
>             }
>         }
>     }
>     finally {
>         responses.done();
>     }
> {code}
> This is because up(Event) always returns null when using a shared transport.
> The same issue affects org.jgroups.protocols.TP.fetchPhysicalAddrs(...):
> {code}
>     if(!missing.isEmpty()) {  // FIND_MBRS either returns immediately or is processed in a separate thread
>         Responses rsps=(Responses)up(new Event(Event.FIND_MBRS, missing));
>         rsps.done();
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.2.6#6264)


More information about the jboss-jira mailing list