Stefan Groschupf wrote:
Beside that a behavior like the datanode that iterates until it find a free port would be a better than just random.
There is a possibility that a test run could start many processes on one machine and a sequential available port search could be contentious. If you can iterate over a port range starting at a "random" place in the range (wrap around when trying other ports), that would eliminate the problem. The place to start in a list of n items could be (n % (ipAddress + processDistinction)) where processDistinction is any integer that would be distinct between the processes running on the same host, like another port number that is already assigned (if any) or the string hash of a name associated with only that process, etc. Paul