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 2019/02/19 13:41:21 UTC

[GitHub] uce commented on a change in pull request #7745: [FLINK-11632] Add new config option for TaskManager automatic address…

uce commented on a change in pull request #7745: [FLINK-11632] Add new config option for TaskManager automatic address…
URL: https://github.com/apache/flink/pull/7745#discussion_r258040555
 
 

 ##########
 File path: flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/TaskManagerRunner.java
 ##########
 @@ -409,13 +409,30 @@ public static RpcService createRpcService(
 		if (taskManagerHostname != null) {
 			LOG.info("Using configured hostname/address for TaskManager: {}.", taskManagerHostname);
 		} else {
-			Time lookupTimeout = Time.milliseconds(AkkaUtils.getLookupTimeout(configuration).toMillis());
-
-			InetAddress taskManagerAddress = LeaderRetrievalUtils.findConnectingAddress(
-				haServices.getResourceManagerLeaderRetriever(),
-				lookupTimeout);
-
-			taskManagerHostname = taskManagerAddress.getHostName();
+			InetAddress taskManagerAddress;
 
 Review comment:
   I don't think we should get rid of the `LeaderRetrievalUtils.findConnectingAddress` call. The question of whether we want the IP or the hostname should be orthogonal to this.
   
   If the heuristics are not needed, I'm happy to change this in a separate PR.
   
   I would propose something like this:
   ```java
   InetAddress taskManagerAddress = LeaderRetrievalUtils.findConnectingAddress(
     haServices.getResourceManagerLeaderRetriever(),
     lookupTimeout);
   
   String bindPolicy = configuration.getString(TaskManagerOptions.HOST_BIND_POLICY);
   switch (bindPolicy.toLowerCase()) {
     case "ip":
       taskManagerHostname = taskManagerAddress.getHostAddress();
       break;
     case "hostname":
       taskManagerHostname = taskManagerAddress.getHostName();
       break;
     default:
       throw new IllegalArgumentException("Unknown " + TaskManagerOptions.HOST_BIND_POLICY.key() + ": " + bindPolicy);
   }
   ```

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