[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2183?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chris Nauroth updated ZOOKEEPER-2183:
-------------------------------------
    Attachment: ZOOKEEPER-2183.005.patch

There was a {{BindException}} in that last run.  It looks like we hit a 
collision with the OS assigning an ephemeral port to a client socket 
connection.  {{SO_REUSEADDR}} only allows re-binding to a port that was 
recently closed but is still in TIME_WAIT state, so it wouldn't help with this. 
 Thinking about this some more, {{PortAssignment}} really ought to stay away 
from the ephemeral port range for exactly this reason.  There is no way to 
guarantee that an ephemeral port returned from {{PortAssignment}} won't be 
consumed by a client before our test code gets an opportunity to bind.

I'm attaching patch v005 to make that change.  I changed 
{{PortAssignment#GLOBAL_MAX_PORT}} from 65535 to 32767 and added a comment 
describing the typical ephemeral port ranges used by common OSes.  I also added 
the property to disable {{JettyAdminServer}} in 
{{WatchEventWhenAutoResetTest}}, a test that was recently fixed in 
ZOOKEEPER-2182.

bq. These are duplicated 

Oops, good catch!  I fixed this too.

I have one more question.  Shall we go ahead with the current patch setting the 
default {{test.junit.threads}} value to 8?  One downside of the concurrent runs 
is that log output gets interleaved from all 8 threads, which might make it 
more difficult for a developer to troubleshoot.  Another way to go would be to 
use a default of 1, but override it to 8 in the ant call from test-patch.sh.  
Developers can always override it too to make things fast if they don't mind 
the interleaved logs.

What's your opinion on this?

> Change test port assignments to improve uniqueness of ports for multiple 
> concurrent test processes on the same host.
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-2183
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2183
>             Project: ZooKeeper
>          Issue Type: Improvement
>          Components: tests
>            Reporter: Chris Nauroth
>            Assignee: Chris Nauroth
>         Attachments: ZOOKEEPER-2183.001.patch, ZOOKEEPER-2183.002.patch, 
> ZOOKEEPER-2183.003.patch, ZOOKEEPER-2183.004.patch, ZOOKEEPER-2183.005.patch, 
> threads-change.patch
>
>
> Tests use {{PortAssignment#unique}} for assignment of the ports to bind 
> during tests.  Currently, this method works by using a monotonically 
> increasing counter from a static starting point.  Generally, this is 
> sufficient to achieve uniqueness within a single JVM process, but it does not 
> achieve uniqueness across multiple processes on the same host.  This can 
> cause tests to get bind errors if there are multiple pre-commit jobs running 
> concurrently on the same Jenkins host.  This also prevents running tests in 
> parallel to improve the speed of pre-commit runs.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to