RFR 8162521, java/net/Authenticator/B4933582.sh fails intermittently with BindException
Daniel Fuchs
daniel.fuchs at oracle.com
Thu Dec 1 10:58:57 UTC 2016
Hi Felix,
Good to see one more script converted to java.
I wonder if the fact that the test use to run two separate
JVMs was significant. Hopefully it's not.
The changes in TestHttpServer seem OK - this class is shared
by many other tests - so any modifications here is to be taken
with care. I trust you ran all the jdk_net tests?
In B4933582.java:
maybe MyAuthenticator.count should be made volatile (or AtomicInteger).
I don't think it's strictly necessary as I believe our implementation
will only call it in the client thread (which is always the main thread
here) - but it may be a better idea to use AtomicInteger anyway: just
make no assumption :-)
I'd also suggest to use try-with-resource to close in
CacheImpl (int port) and CacheImpl::writeMap to make sure
the file is always properly closed.
best regards,
-- daniel
On 01/12/16 09:47, Felix Yang wrote:
> Hi,
>
> please review the following patch. The code was converted from shell
> script to plain Java. Since it is by-design to bind on a prior-used
> port, add a few of re-tries for possible BindException.
>
> Bug:
>
> https://bugs.openjdk.java.net/browse/JDK-8162521
>
> Webrev:
>
> http://cr.openjdk.java.net/~xiaofeya/8162521/webrev.00/
>
> Thanks,
> Felix
More information about the core-libs-dev
mailing list