You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2018/04/09 23:01:39 UTC

[GitHub] sijie closed pull request #1323: Improve "Failed to resolve network location" logging

sijie closed pull request #1323: Improve "Failed to resolve network location" logging
URL: https://github.com/apache/bookkeeper/pull/1323
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/net/BookieSocketAddress.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/net/BookieSocketAddress.java
index e7f980477..4e8f3246c 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/net/BookieSocketAddress.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/net/BookieSocketAddress.java
@@ -81,7 +81,8 @@ public InetSocketAddress getSocketAddress() {
      * Maps the socketAddress to a "local" address.
      */
     public LocalAddress getLocalAddress() {
-        return new LocalAddress(socketAddress.toString());
+        // for local address, we just need "port" to differentiate different addresses.
+        return new LocalAddress("" + port);
     }
 
     // Return the String "serialized" version of this object.
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/net/ScriptBasedMapping.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/net/ScriptBasedMapping.java
index 49f3c9a70..8c8350c3f 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/net/ScriptBasedMapping.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/net/ScriptBasedMapping.java
@@ -145,6 +145,10 @@ public void setConf(Configuration conf) {
                 scriptName = null;
                 maxArgs = 0;
             }
+
+            if (null == scriptName) {
+                throw new RuntimeException("No network topology script is found when using script based DNS resolver.");
+            }
         }
 
         /**


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services