Github user tillrohrmann commented on a diff in the pull request:
https://github.com/apache/flink/pull/3391#discussion_r103954040
--- Diff: flink-core/src/main/java/org/apache/flink/util/NetUtils.java ---
@@ -373,6 +374,46 @@ public static ServerSocket
createSocketFromPorts(Iterator<Integer> portsIterator
}
/**
+ * Tries to create a server from the given sets of ports.
+ *
+ * @param address An address to listen at.
+ * @param portRange A set of ports to choose from.
+ * @param serverFactory A factory for creating server.
+ * @return the created server.
+ * @throws BindException If port range is exhausted.
+ */
+ public static <T> T createServerFromPorts(String address,
Iterator<Integer> portRange, ServerFactory<T> serverFactory) throws Exception {
--- End diff --
I think we should add some tests for this function. Especially to properly
test how it behaves in case of `Exceptions`.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---