Adding time limit for Driver address binding. (#1390)

* Adding time limit for Driver address binding. Otherwise it just hangs infinietly

* Addressing review comments

* Addressing review comments
This commit is contained in:
mkit 2017-09-04 15:48:38 +01:00 committed by GitHub
parent 4150316367
commit 7a6120970d

View File

@ -370,8 +370,13 @@ fun addressMustBeBoundFuture(executorService: ScheduledExecutorService, hostAndP
}
}
fun addressMustNotBeBound(executorService: ScheduledExecutorService, hostAndPort: NetworkHostAndPort) {
addressMustNotBeBoundFuture(executorService, hostAndPort).getOrThrow()
/*
* The default timeout value of 40 seconds have been chosen based on previous node shutdown time estimate.
* It's been observed that nodes can take up to 30 seconds to shut down, so just to stay on the safe side the 40 seconds
* timeout has been chosen.
*/
fun addressMustNotBeBound(executorService: ScheduledExecutorService, hostAndPort: NetworkHostAndPort, timeout: Duration = 40.seconds) {
addressMustNotBeBoundFuture(executorService, hostAndPort).getOrThrow(timeout)
}
fun addressMustNotBeBoundFuture(executorService: ScheduledExecutorService, hostAndPort: NetworkHostAndPort): CordaFuture<Unit> {