While we correctly use ephemeral ports to create ServerSockets for the SocketBasedRemoteExecutor, there's a possibility that ports provided by the AvailablePortIterator may accidentally be taken by the SocketBasedRemoteExecutor prior to an application starting, especially when the AvailablePortIterator port range overlaps with the operating system ephemeral port range.
The simple solution is to use the AvailablePortIterator (and keep trying) when creating a SocketBasedRemoteExecutor.
While we correctly use ephemeral ports to create ServerSockets for the SocketBasedRemoteExecutor, there's a possibility that ports provided by the AvailablePortIterator may accidentally be taken by the SocketBasedRemoteExecutor prior to an application starting, especially when the AvailablePortIterator port range overlaps with the operating system ephemeral port range.
The simple solution is to use the AvailablePortIterator (and keep trying) when creating a SocketBasedRemoteExecutor.