You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/08/26 21:02:56 UTC

[GitHub] [pulsar] aahmed-se commented on a change in pull request #5024: Improve Port Manager

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:
users@infra.apache.org


With regards,
Apache Git Services