Description
I've run into a situation where my machine can't find a port with the default TcpPortProvider. Why it can't find a port after 1000 random tries is still beyond me. However, I do think I found a bug.
Basically, NettyMessagingTransport finishes its constructor even when the port is bound, because of the following:
if (!ports.hasNext()) { break; }
Then, I run into a NullPointerException later on close, because the acceptor field is null.
java.lang.NullPointerException at org.apache.reef.wake.remote.transport.netty.NettyMessagingTransport.close(NettyMessagingTransport.java:213) at org.apache.reef.wake.remote.impl.DefaultRemoteManagerImplementation$1.run(DefaultRemoteManagerImplementation.java:221) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745)
Should we just raise a RuntimeException if a port can't be found? Or, is there any way to "recover" from this?