demery-pivotal opened a new pull request #6986: URL: https://github.com/apache/geode/pull/6986
`AvailablePort` and `AvailablePortHelper` have methods to retrieve an "available" port from the membership port range. This feature is both unnecessary and inherently unreliable. INHERENTLY UNRELIABLE The default membership port range overlaps each OS's ephemeral port range. An ephemeral port deemed to be "available" by one of these methods can be put into use by another process even before the method returns. It is not safe to rely on such a port to remain available after it is checked. UNNECESSARY Currently the only callers that request ports from the membership port range are two tests in `DistributedSystemDUnitTest`. In each case, the test uses the returned ports to *set* the membership port range for a member. There is no need for the ports to come from any particular range. There are no other uses of this feature, either in the product or in tests. SOLUTION Remove the "membership port range" feature from `AvailablePort` and `AvailablePortHelper`. Change `DistributedSystemDUnitTest` to get available ports from the "available port range." This range is safe to use (assuming all other concurrently-running tests are well-behaved). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
