Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/6288#discussion_r202171601
  
    --- Diff: 
flink-mesos/src/main/java/org/apache/flink/mesos/runtime/clusterframework/LaunchableMesosWorker.java
 ---
    @@ -332,6 +334,22 @@ public String toString() {
                return taskInfo.build();
        }
     
    +   /**
    +    * Get port keys representing the TM's configured endpoints. This 
includes mandatory TM endpoints such as
    +    * data and rpc as well as optionally configured endpoints for services 
such as prometheus reporter
    +    *
    +    * @return A deterministicly ordered Set of port keys to expose from 
the TM container
    +    */
    +   private Set<String> getPortKeys() {
    +           LinkedHashSet<String> tmPortKeys = new 
LinkedHashSet<>(Arrays.asList(TM_PORT_KEYS));
    +           containerSpec.getDynamicConfiguration().keySet().stream()
    +                   .filter(key -> key.endsWith(".port") || 
key.endsWith(".ports"))  // This matches property naming convention
    --- End diff --
    
    I agree that simply taking all configuration values which end with `port` 
and `ports` is problematic. What about configuration values whose value is 
needed, e.g. remote ports, and should not be overwritten. For example the 
`jobmanager.rpc.port` is one of these configuration values.
    
    I would rather prefer a mesos specific configuration value which we can use 
to define whose ports need to be dynamically assigned. For example 
`mesos.dynamic-port-assignment: "metrics.prom.port, taskmanager.rpc.port, 
taskmanager.data.port"`. What do you think?


---

Reply via email to