Github user ahgittin commented on a diff in the pull request:
    --- Diff: 
launcher/src/main/java/org/apache/brooklyn/launcher/ ---
    @@ -447,7 +450,15 @@ public synchronized void start() throws Exception {
             rootContext.setTempDirectory(Os.mkdirs(new File(webappTempDir, 
    -        server.start();
    +        try {
    +            server.start();
    +        } catch (BindException e) {
    +            // port discovery routines may take some time to clear, e.g. 
250ms for SO_TIMEOUT
    +            // tests fail because of this; see if adding a delay improves 
    +            log.warn("Initial server start-up failed binding (retrying 
after a delay): "+e);
    +            Time.sleep(Duration.millis(500));
    +            server.start();
    --- End diff --
    @neykov Why would `setReuseAddress(true)` improve false positives?  As long 
as we make the same call when we start the server it should be identical?  (Or 
are you thinking that the root cause is that the server-start call isn't using 
that, and that is what you'd fix?)
    I agree finding and fixing the root cause (and recognising and logging 
better when we encounter it?) is even better, but I don't know what it is!
    I don't think we do parallel tests so I suspect that isn't the issue.  
Letting sockets pick their own ports is a big change so I'd rather not go down 
that line.

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

Reply via email to