[hotfix] Use InetAddress.getLocalHost() as first approach when detecting the TMs own ip/hostname
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/net/NetUtils.java b/flink-runtime/src/main/java/org/apache/flink/runtime/net/NetUtils.java
index 94073db..e4cbbb8 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/net/NetUtils.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/net/NetUtils.java
@@ -183,6 +183,14 @@
long currentSleepTime = MIN_SLEEP_TIME;
long elapsedTime = 0;
+ // before trying with different strategies: test with getLocalHost():
+ InetAddress localhostName = InetAddress.getLocalHost();
+
+ if(tryToConnect(localhostName, targetAddress, AddressDetectionState.ADDRESS.getTimeout(), false)) {
+ LOG.debug("Using immediately InetAddress.getLocalHost() for the connecting address");
+ return localhostName;
+ }
+
// loop while there is time left
while (elapsedTime < maxWaitMillis) {
AddressDetectionState strategy = AddressDetectionState.ADDRESS;