Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-737

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 0.6
    • None
    • None
    • Mac OS X.

    • Low

    Description

      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).

      Attachments

        Issue Links

          Activity

            People

              gdusbabek Gary Dusbabek
              gdusbabek Gary Dusbabek
              Gary Dusbabek
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: