Qpid
  1. Qpid
  2. QPID-4931

Broker should only listen to a single network address if "--port 0" is specified

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.23
    • Component/s: C++ Broker
    • Labels:
      None

      Description

      The C++ broker has a setting which is really only useful for testing which allows the broker to listen to whichever port the kernel gives it. In this mode it prints the received port on stdout for subsequent testing programs to use.

      When you listen to multiple network addresses (addresses are multiple network interfaces or multiple protocols on the same network interface - IPv4 & IPv6 for example) the broker has to remember the port it got for the first address and then try to get the same port for subsequent addresses.

      Unfortunately there is no guarantee that the same port will actually be available on the other addresses so the entire broker startup can fail.

      In the testing environment which this is useful for you only care about the IPv4 loopback address in any case so we have to ensure that this address is the only (or at least the first) address used.

      Because we can't guarantee getting the same port for more than one address it makes sense to restrict "--port 0" to only listening to a single address.

      I propose that if the broker detects that more than one address has been specified or is implied by the network setup it should list to the first address and log a warning message with the actual address listened to.

        Activity

        Hide
        Justin Ross added a comment -
        Show
        Justin Ross added a comment - Released in Qpid 0.24, http://qpid.apache.org/releases/qpid-0.24/index.html
        Hide
        ASF subversion and git services added a comment -

        Commit 1494712 from Andrew Stitcher
        [ https://svn.apache.org/r1494712 ]

        QPID-4931: Remove removed member function from windows SocketAddress
        code too. While there bring this code up to date with other recent
        changes to the POSIX equivalent code.

        Show
        ASF subversion and git services added a comment - Commit 1494712 from Andrew Stitcher [ https://svn.apache.org/r1494712 ] QPID-4931 : Remove removed member function from windows SocketAddress code too. While there bring this code up to date with other recent changes to the POSIX equivalent code.
        Hide
        ASF subversion and git services added a comment -

        Commit 1494656 from Andrew Stitcher
        [ https://svn.apache.org/r1494656 ]

        QPID-4931: Only allow broker to listen to a single address if "--port 0" specified

        • If more than one address is specified or implied by the defaults the broker
          will log a warning
        • This is intended to avoid testing problems where the broker fails to connect
          to the port of subsequent listening addresses
        Show
        ASF subversion and git services added a comment - Commit 1494656 from Andrew Stitcher [ https://svn.apache.org/r1494656 ] QPID-4931 : Only allow broker to listen to a single address if "--port 0" specified If more than one address is specified or implied by the defaults the broker will log a warning This is intended to avoid testing problems where the broker fails to connect to the port of subsequent listening addresses

          People

          • Assignee:
            Andrew Stitcher
            Reporter:
            Andrew Stitcher
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development