diff options
author | Arne Juul <arnej@yahoo-inc.com> | 2017-09-08 11:21:32 +0000 |
---|---|---|
committer | Arne Juul <arnej@yahoo-inc.com> | 2017-09-08 11:22:03 +0000 |
commit | d6e45f8ce331e4d12f907ac132621a5cfd5d76ce (patch) | |
tree | 55808aa7c308ec0906ba87c197a964c0ea1de59f | |
parent | 6114ed7de87cddb05225c3f152d61998e237633e (diff) |
use HostName.getLocalhost
-rw-r--r-- | vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/ClientFeederV3.java | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/ClientFeederV3.java b/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/ClientFeederV3.java index 13ee837e1d4..5f1c96d000f 100644 --- a/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/ClientFeederV3.java +++ b/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/ClientFeederV3.java @@ -14,6 +14,7 @@ import com.yahoo.messagebus.Message; import com.yahoo.messagebus.ReplyHandler; import com.yahoo.messagebus.Result; import com.yahoo.messagebus.shared.SharedSourceSession; +import com.yahoo.net.HostName; import com.yahoo.vespa.http.client.core.ErrorCode; import com.yahoo.vespa.http.client.core.Headers; import com.yahoo.vespa.http.client.core.OperationStatus; @@ -23,8 +24,6 @@ import com.yahoo.yolean.Exceptions; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import java.net.InetAddress; -import java.net.UnknownHostException; import java.time.Duration; import java.time.Instant; import java.util.Optional; @@ -75,12 +74,7 @@ class ClientFeederV3 { this.metric = metric; this.threadsAvailableForFeeding = threadsAvailableForFeeding; this.streamReaderV3 = new StreamReaderV3(feedReaderFactory, docTypeManager); - try { - this.hostName = InetAddress.getLocalHost().getHostName(); - } catch (UnknownHostException e) { - log.info("Could not find hostname, randomizing. " + e.getMessage()); - hostName = "UNKNOWNHOSTNAME" + System.nanoTime() % 10000; - } + this.hostName = HostName.getLocalhost(); } public boolean timedOut() { |