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

Report why native_transport_port fails to bind

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 4.0-alpha1, 4.0
    • None
    • None
    • Normal

    Description

      On line 164 of org/apache/cassandra/transport/Server.java, the cause of a failure to bind to the server port is swallowed:

      https://github.com/apache/cassandra/blob/06209037ea56b5a2a49615a99f1542d6ea1b2947/src/java/org/apache/cassandra/transport/Server.java#L163-L164

              if (!bindFuture.awaitUninterruptibly().isSuccess())
                  throw new IllegalStateException(String.format("Failed to bind port %d on %s.", socket.getPort(), socket.getAddress().getHostAddress()));
      

      So we're told that the bind failed, but we're left guessing as to why. The cause of the bind failure should be passed to the IllegalStateException, so that we can then proceed with debugging, like so:

              if (!bindFuture.awaitUninterruptibly().isSuccess())
                  throw new IllegalStateException(String.format("Failed to bind port %d on %s.", socket.getPort(), socket.getAddress().getHostAddress()),
                      bindFuture.cause());
      

      Attachments

        Activity

          People

            jroper James Roper
            jroper James Roper
            James Roper
            Dinesh Joshi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: