You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hama.apache.org by "Tommaso Teofili (Created) (JIRA)" <ji...@apache.org> on 2011/11/29 21:21:44 UTC

[jira] [Created] (HAMA-482) LocalBSPRunner cannot deliver multiple messages to the same peer

LocalBSPRunner cannot deliver multiple messages to the same peer 
-----------------------------------------------------------------

                 Key: HAMA-482
                 URL: https://issues.apache.org/jira/browse/HAMA-482
             Project: Hama
          Issue Type: Bug
            Reporter: Tommaso Teofili
            Assignee: Tommaso Teofili
             Fix For: 0.4.0


the line 331 of LocalBSPRunner contains a warning which may result in bugs with multiple messages.
In fact 
{code}
LinkedList<BSPMessage> msgs = localOutgoingMessages.get(peerName);
{code}

is trying to get a List of BSPMessage instances from a localOutgoingMessages of type {code}HashMap<InetSocketAddress, LinkedList<BSPMessage>>{code}.

It seems to me there is problem as peerName is a String, not a InetSocketAddress and in fact my debugging session highlighted that get() method to result always to return a null object.

The quick fix seems to be putting the lines 337-341 :
{code}
      InetSocketAddress inetSocketAddress = socketCache.get(peerName);
      if (inetSocketAddress == null) {
        inetSocketAddress = BSPNetUtils.getAddress(peerName);
        socketCache.put(peerName, inetSocketAddress);
      }
{code}
upmost in the method and then call 

{code}
LinkedList<BSPMessage> msgs = localOutgoingMessages.get(inetSocketAddress);
{code}

This was highlighted when dealing with multiple messages sent to a same peer in local mode (only the last msg was actually stored in the outGoingMessages item for that peer).

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

        

[jira] [Resolved] (HAMA-482) LocalBSPRunner cannot deliver multiple messages to the same peer

Posted by "Tommaso Teofili (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HAMA-482?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tommaso Teofili resolved HAMA-482.
----------------------------------

    Resolution: Fixed

fixed in r1208054
                
> LocalBSPRunner cannot deliver multiple messages to the same peer 
> -----------------------------------------------------------------
>
>                 Key: HAMA-482
>                 URL: https://issues.apache.org/jira/browse/HAMA-482
>             Project: Hama
>          Issue Type: Bug
>            Reporter: Tommaso Teofili
>            Assignee: Tommaso Teofili
>             Fix For: 0.4.0
>
>
> the line 331 of LocalBSPRunner contains a warning which may result in bugs with multiple messages.
> In fact 
> {code}
> LinkedList<BSPMessage> msgs = localOutgoingMessages.get(peerName);
> {code}
> is trying to get a List of BSPMessage instances from a localOutgoingMessages of type {code}HashMap<InetSocketAddress, LinkedList<BSPMessage>>{code}.
> It seems to me there is problem as peerName is a String, not a InetSocketAddress and in fact my debugging session highlighted that get() method to result always to return a null object.
> The quick fix seems to be putting the lines 337-341 :
> {code}
>       InetSocketAddress inetSocketAddress = socketCache.get(peerName);
>       if (inetSocketAddress == null) {
>         inetSocketAddress = BSPNetUtils.getAddress(peerName);
>         socketCache.put(peerName, inetSocketAddress);
>       }
> {code}
> upmost in the method and then call 
> {code}
> LinkedList<BSPMessage> msgs = localOutgoingMessages.get(inetSocketAddress);
> {code}
> This was highlighted when dealing with multiple messages sent to a same peer in local mode (only the last msg was actually stored in the outGoingMessages item for that peer).

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

        

[jira] [Commented] (HAMA-482) LocalBSPRunner cannot deliver multiple messages to the same peer

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HAMA-482?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13159642#comment-13159642 ] 

Hudson commented on HAMA-482:
-----------------------------

Integrated in Hama-Nightly #372 (See [https://builds.apache.org/job/Hama-Nightly/372/])
    [HAMA-482] - InetSocketAddress is initialized first by peerName and then used accordingly with localOutgoingMessages

tommaso : 
Files : 
* /incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/LocalBSPRunner.java

                
> LocalBSPRunner cannot deliver multiple messages to the same peer 
> -----------------------------------------------------------------
>
>                 Key: HAMA-482
>                 URL: https://issues.apache.org/jira/browse/HAMA-482
>             Project: Hama
>          Issue Type: Bug
>            Reporter: Tommaso Teofili
>            Assignee: Tommaso Teofili
>             Fix For: 0.4.0
>
>
> the line 331 of LocalBSPRunner contains a warning which may result in bugs with multiple messages.
> In fact 
> {code}
> LinkedList<BSPMessage> msgs = localOutgoingMessages.get(peerName);
> {code}
> is trying to get a List of BSPMessage instances from a localOutgoingMessages of type {code}HashMap<InetSocketAddress, LinkedList<BSPMessage>>{code}.
> It seems to me there is problem as peerName is a String, not a InetSocketAddress and in fact my debugging session highlighted that get() method to result always to return a null object.
> The quick fix seems to be putting the lines 337-341 :
> {code}
>       InetSocketAddress inetSocketAddress = socketCache.get(peerName);
>       if (inetSocketAddress == null) {
>         inetSocketAddress = BSPNetUtils.getAddress(peerName);
>         socketCache.put(peerName, inetSocketAddress);
>       }
> {code}
> upmost in the method and then call 
> {code}
> LinkedList<BSPMessage> msgs = localOutgoingMessages.get(inetSocketAddress);
> {code}
> This was highlighted when dealing with multiple messages sent to a same peer in local mode (only the last msg was actually stored in the outGoingMessages item for that peer).

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