You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2018/11/30 14:32:11 UTC

[GitHub] dawidwys commented on a change in pull request #6862: [FLINK-10213] Task managers cache a negative DNS lookup of the blob server indefinitely

dawidwys commented on a change in pull request #6862: [FLINK-10213] Task managers cache a negative DNS lookup of the blob server indefinitely
URL: https://github.com/apache/flink/pull/6862#discussion_r237878535
 
 

 ##########
 File path: flink-runtime/src/main/java/org/apache/flink/runtime/blob/BlobClient.java
 ##########
 @@ -87,12 +87,13 @@ public BlobClient(InetSocketAddress serverAddress, Configuration clientConfig) t
 				LOG.info("Using ssl connection to the blob server");
 
 				socket = SSLUtils.createSSLClientSocketFactory(clientConfig).createSocket(
-					serverAddress.getAddress(),
+					serverAddress.getHostName(),
 					serverAddress.getPort());
 			}
 			else {
-				socket = new Socket();
-				socket.connect(serverAddress);
+				// Establish the socket using the hostname and port. This avoids a potential issue where the
+				// InetSocketAddress can cache a failure in hostname resolution forever.
+				socket = new Socket(serverAddress.getHostName(), serverAddress.getPort());
 
 Review comment:
   How about doing the lookup only if the `InetSocketAddress` was not resolved?
   
   ```
   socket = new Socket();
   if (serverAddress.isUnresolved()) {
   	socket.connect(new InetSocketAddress(serverAddress.getHostName(), serverAddress.getPort()));
   } else {
   	socket.connect(serverAddress);
   }
   ```

----------------------------------------------------------------
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