You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Gary Dusbabek (JIRA)" <ji...@apache.org> on 2010/01/25 20:46:35 UTC

[jira] Created: (CASSANDRA-737) Streaming code relies on sockets being bound to the correct address (InetAddress.anyLocalAddress() is bad)

Streaming code relies on sockets being bound to the correct address (InetAddress.anyLocalAddress() is bad)
----------------------------------------------------------------------------------------------------------

                 Key: CASSANDRA-737
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-737
             Project: Cassandra
          Issue Type: Bug
    Affects Versions: 0.6
         Environment: Mac OS X.
            Reporter: Gary Dusbabek
            Assignee: Gary Dusbabek
            Priority: Minor
             Fix For: 0.6


I came across this while testing streaming locally.  The new streaming code makes use of the remote socket address supplied by the socket.  This means that it will return whatever address the socket is bound to, which is not necessarily the address configured for cassandra.  This confuses StreamContextManager when data comes streaming in from addresses that it doesn't recognize.

Two solutions will work.
1. bind outgoing sockets to the correct interface.
2. Include the local address in StreamContexts that get sent.

I opted for 1 since it required less code.  2 was easy enough but would have required changing the format of the message to make the source address more easily accessible (the constructor for IncomingStreamReader wants to know the source host to create the stream context at the destination).

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


[jira] Commented: (CASSANDRA-737) Streaming code relies on sockets being bound to the correct address (InetAddress.anyLocalAddress() is bad)

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-737?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12804677#action_12804677 ] 

Jonathan Ellis commented on CASSANDRA-737:
------------------------------------------

does this affect 0.5 too?

> Streaming code relies on sockets being bound to the correct address (InetAddress.anyLocalAddress() is bad)
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-737
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-737
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 0.6
>         Environment: Mac OS X.
>            Reporter: Gary Dusbabek
>            Assignee: Gary Dusbabek
>            Priority: Minor
>             Fix For: 0.6
>
>         Attachments: 737.patch
>
>
> I came across this while testing streaming locally.  The new streaming code makes use of the remote socket address supplied by the socket.  This means that it will return whatever address the socket is bound to, which is not necessarily the address configured for cassandra.  This confuses StreamContextManager when data comes streaming in from addresses that it doesn't recognize.
> Two solutions will work.
> 1. bind outgoing sockets to the correct interface.
> 2. Include the local address in StreamContexts that get sent.
> I opted for 1 since it required less code.  2 was easy enough but would have required changing the format of the message to make the source address more easily accessible (the constructor for IncomingStreamReader wants to know the source host to create the stream context at the destination).

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


[jira] Commented: (CASSANDRA-737) Streaming code relies on sockets being bound to the correct address (InetAddress.anyLocalAddress() is bad)

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-737?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12804700#action_12804700 ] 

Jonathan Ellis commented on CASSANDRA-737:
------------------------------------------

is your working copy up to date?  the patch to OutboundTcpConnection.java fails to apply for me

> Streaming code relies on sockets being bound to the correct address (InetAddress.anyLocalAddress() is bad)
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-737
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-737
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 0.6
>         Environment: Mac OS X.
>            Reporter: Gary Dusbabek
>            Assignee: Gary Dusbabek
>            Priority: Minor
>             Fix For: 0.6
>
>         Attachments: 737.patch
>
>
> I came across this while testing streaming locally.  The new streaming code makes use of the remote socket address supplied by the socket.  This means that it will return whatever address the socket is bound to, which is not necessarily the address configured for cassandra.  This confuses StreamContextManager when data comes streaming in from addresses that it doesn't recognize.
> Two solutions will work.
> 1. bind outgoing sockets to the correct interface.
> 2. Include the local address in StreamContexts that get sent.
> I opted for 1 since it required less code.  2 was easy enough but would have required changing the format of the message to make the source address more easily accessible (the constructor for IncomingStreamReader wants to know the source host to create the stream context at the destination).

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


[jira] Updated: (CASSANDRA-737) Streaming code relies on sockets being bound to the correct address (InetAddress.anyLocalAddress() is bad)

Posted by "Gary Dusbabek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-737?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary Dusbabek updated CASSANDRA-737:
------------------------------------

    Attachment: 737.patch

I think I caught all the socket creation places.

> Streaming code relies on sockets being bound to the correct address (InetAddress.anyLocalAddress() is bad)
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-737
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-737
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 0.6
>         Environment: Mac OS X.
>            Reporter: Gary Dusbabek
>            Assignee: Gary Dusbabek
>            Priority: Minor
>             Fix For: 0.6
>
>         Attachments: 737.patch
>
>
> I came across this while testing streaming locally.  The new streaming code makes use of the remote socket address supplied by the socket.  This means that it will return whatever address the socket is bound to, which is not necessarily the address configured for cassandra.  This confuses StreamContextManager when data comes streaming in from addresses that it doesn't recognize.
> Two solutions will work.
> 1. bind outgoing sockets to the correct interface.
> 2. Include the local address in StreamContexts that get sent.
> I opted for 1 since it required less code.  2 was easy enough but would have required changing the format of the message to make the source address more easily accessible (the constructor for IncomingStreamReader wants to know the source host to create the stream context at the destination).

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


[jira] Commented: (CASSANDRA-737) Streaming code relies on sockets being bound to the correct address (InetAddress.anyLocalAddress() is bad)

Posted by "Gary Dusbabek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-737?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12804680#action_12804680 ] 

Gary Dusbabek commented on CASSANDRA-737:
-----------------------------------------

No. This came in at the same time as IncomingStreamReader.  Before that, I don't think we relied on the remote address of a socket being the address specified in the config.  It hadn't mattered.

> Streaming code relies on sockets being bound to the correct address (InetAddress.anyLocalAddress() is bad)
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-737
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-737
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 0.6
>         Environment: Mac OS X.
>            Reporter: Gary Dusbabek
>            Assignee: Gary Dusbabek
>            Priority: Minor
>             Fix For: 0.6
>
>         Attachments: 737.patch
>
>
> I came across this while testing streaming locally.  The new streaming code makes use of the remote socket address supplied by the socket.  This means that it will return whatever address the socket is bound to, which is not necessarily the address configured for cassandra.  This confuses StreamContextManager when data comes streaming in from addresses that it doesn't recognize.
> Two solutions will work.
> 1. bind outgoing sockets to the correct interface.
> 2. Include the local address in StreamContexts that get sent.
> I opted for 1 since it required less code.  2 was easy enough but would have required changing the format of the message to make the source address more easily accessible (the constructor for IncomingStreamReader wants to know the source host to create the stream context at the destination).

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


[jira] Commented: (CASSANDRA-737) Streaming code relies on sockets being bound to the correct address (InetAddress.anyLocalAddress() is bad)

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-737?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12804709#action_12804709 ] 

Jonathan Ellis commented on CASSANDRA-737:
------------------------------------------

+1 (damn intellij, it's not like patch format hasn't been standard for years)

> Streaming code relies on sockets being bound to the correct address (InetAddress.anyLocalAddress() is bad)
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-737
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-737
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 0.6
>         Environment: Mac OS X.
>            Reporter: Gary Dusbabek
>            Assignee: Gary Dusbabek
>            Priority: Minor
>             Fix For: 0.6
>
>         Attachments: 0001-bind-sockets-locally-to-cassandra-specified-address.patch
>
>
> I came across this while testing streaming locally.  The new streaming code makes use of the remote socket address supplied by the socket.  This means that it will return whatever address the socket is bound to, which is not necessarily the address configured for cassandra.  This confuses StreamContextManager when data comes streaming in from addresses that it doesn't recognize.
> Two solutions will work.
> 1. bind outgoing sockets to the correct interface.
> 2. Include the local address in StreamContexts that get sent.
> I opted for 1 since it required less code.  2 was easy enough but would have required changing the format of the message to make the source address more easily accessible (the constructor for IncomingStreamReader wants to know the source host to create the stream context at the destination).

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


[jira] Updated: (CASSANDRA-737) Streaming code relies on sockets being bound to the correct address (InetAddress.anyLocalAddress() is bad)

Posted by "Gary Dusbabek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-737?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary Dusbabek updated CASSANDRA-737:
------------------------------------

    Attachment:     (was: 737.patch)

> Streaming code relies on sockets being bound to the correct address (InetAddress.anyLocalAddress() is bad)
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-737
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-737
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 0.6
>         Environment: Mac OS X.
>            Reporter: Gary Dusbabek
>            Assignee: Gary Dusbabek
>            Priority: Minor
>             Fix For: 0.6
>
>         Attachments: 0001-bind-sockets-locally-to-cassandra-specified-address.patch
>
>
> I came across this while testing streaming locally.  The new streaming code makes use of the remote socket address supplied by the socket.  This means that it will return whatever address the socket is bound to, which is not necessarily the address configured for cassandra.  This confuses StreamContextManager when data comes streaming in from addresses that it doesn't recognize.
> Two solutions will work.
> 1. bind outgoing sockets to the correct interface.
> 2. Include the local address in StreamContexts that get sent.
> I opted for 1 since it required less code.  2 was easy enough but would have required changing the format of the message to make the source address more easily accessible (the constructor for IncomingStreamReader wants to know the source host to create the stream context at the destination).

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


[jira] Updated: (CASSANDRA-737) Streaming code relies on sockets being bound to the correct address (InetAddress.anyLocalAddress() is bad)

Posted by "Gary Dusbabek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-737?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary Dusbabek updated CASSANDRA-737:
------------------------------------

    Attachment: 0001-bind-sockets-locally-to-cassandra-specified-address.patch

The last patch was Intellij generated.  Here is a git-generated patch.

> Streaming code relies on sockets being bound to the correct address (InetAddress.anyLocalAddress() is bad)
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-737
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-737
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 0.6
>         Environment: Mac OS X.
>            Reporter: Gary Dusbabek
>            Assignee: Gary Dusbabek
>            Priority: Minor
>             Fix For: 0.6
>
>         Attachments: 0001-bind-sockets-locally-to-cassandra-specified-address.patch
>
>
> I came across this while testing streaming locally.  The new streaming code makes use of the remote socket address supplied by the socket.  This means that it will return whatever address the socket is bound to, which is not necessarily the address configured for cassandra.  This confuses StreamContextManager when data comes streaming in from addresses that it doesn't recognize.
> Two solutions will work.
> 1. bind outgoing sockets to the correct interface.
> 2. Include the local address in StreamContexts that get sent.
> I opted for 1 since it required less code.  2 was easy enough but would have required changing the format of the message to make the source address more easily accessible (the constructor for IncomingStreamReader wants to know the source host to create the stream context at the destination).

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