BDEV-13675 Check JMX port on 127.0.0.1 explicitly.
Bryan Turner
Branch: issue-6.3/BDEV-13675-bturner-free-loopback-port
Branch: 6.3-stable
Merged
Merged pull request
Merged in issue-6.3/BDEV-13675-bturner-free-loopback-port (pull request #271)
Merged in issue-6.3/BDEV-13675-bturner-free-loopback-port (pull request #271)
macOS appears to have a different behavior from other operating systems which results in new ServerSocket(7995) working, even if 127.0.0.1:7995 is in use. This results in failures when trying to start more than one instance of Bitbucket Server on the same macOS host because the second instance doesn't detect that the first instance has taken the default JMX port.
Added ProductHandlerUtil.pickFreePort(int, InetAddress) to allow testing for a free port on a specific interface
Updated BitbucketProductHandler.pickJmxPort to explicitly test for a free port on 127.0.0.1