aahmed-se commented on a change in pull request #5024: Improve Port Manager
URL: https://github.com/apache/pulsar/pull/5024#discussion_r317797569
 
 

 ##########
 File path: 
managed-ledger/src/test/java/org/apache/bookkeeper/test/PortManager.java
 ##########
 @@ -95,7 +97,9 @@ private synchronized static int probeFreePort(int port) {
                 port = basePort;
             }
 
-            try (ServerSocket ss = new ServerSocket(port)) {
+            try (ServerSocket ss = new ServerSocket()) {
+                ss.setReuseAddress(false);
+                ss.bind(new 
InetSocketAddress(InetAddress.getByName("localhost"), port), 1);
 
 Review comment:
   The default value of this socket option is system dependent. It cannot be 
guaranteed in advance.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to