Github user tillrohrmann commented on a diff in the pull request:
https://github.com/apache/flink/pull/3416#discussion_r104387798
--- Diff:
flink-runtime/src/main/scala/org/apache/flink/runtime/akka/AkkaUtils.scala ---
@@ -720,5 +722,55 @@ object AkkaUtils {
if (sslEnabled) "akka.ssl.tcp" else "akka.tcp"
}
+ /**
+ * Retries a function if it fails because of a
[[java.net.BindException]].
+ *
+ * @param fn The function to retry
+ * @param stopCond Flag to signal termination
+ * @param maxSleepBetweenRetries Max random sleep time between retries
+ * @tparam T Return type of the the function to retry
+ * @return Return value of the the function to retry
+ */
+ @tailrec
+ def retryOnBindException[T](
+ fn: => T,
+ stopCond: => Boolean,
+ maxSleepBetweenRetries : Long = 0 )
+ : scala.util.Try[T] = {
--- End diff --
Flink's (implicit) Scala style is as follows:
```
def foobar(
a: Int,
b: Float)
: Double = {
// barfoo
}
```
---
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.
---