You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Todd Lipcon (JIRA)" <ji...@apache.org> on 2010/04/25 02:30:49 UTC

[jira] Updated: (HADOOP-6722) NetUtils.connect should check that it hasn't connected a socket to itself

     [ https://issues.apache.org/jira/browse/HADOOP-6722?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Todd Lipcon updated HADOOP-6722:
--------------------------------

    Attachment: hadoop-6722.txt

Here's a patch which detects this situation and throws a ConnectException.

The test case manufactures the problem by binding to an ephemeral port and then trying to connect to itself.

(fwiw, I actually did run into this issue while testing hbase under failure injection scenarios - a client tried to open RPC to the hbase server, but got itself instead, and was very unhappy)

> NetUtils.connect should check that it hasn't connected a socket to itself
> -------------------------------------------------------------------------
>
>                 Key: HADOOP-6722
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6722
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: util
>            Reporter: Todd Lipcon
>            Assignee: Todd Lipcon
>         Attachments: hadoop-6722.txt
>
>
> I had no idea this was possible, but it turns out that a TCP connection will be established in the rare case that the local side of the socket binds to the ephemeral port that you later try to connect to. This can present itself in very very rare occasion when an RPC client is trying to connect to a daemon running on the same node, but that daemon is down. To see what I'm talking about, run "while true ; do telnet localhost 60020 ; done" on a multicore box and wait several minutes.
> This can be easily detected in NetUtils.connect by making sure the local address/port is not equal to the remote address/port.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.