RFR JDK-8225474: JDI connector accept fails "Address already in use" with concurrent listeners

Robert Field robert.field at oracle.com
Mon Jun 10 19:25:13 UTC 2019


Thanks Andrew!

If you want more data points on failure modes, this and the linked 
issues might be a rich source:

https://bugs.openjdk.java.net/browse/JDK-8184445

JShell is built on JDI and these various forms of intermittent attach 
failures have been a continual pain point.

-Robert


On 6/10/19 1:30 AM, Andrew Leonard wrote:
> Thanks for the feedback everyone.
>
> Hi Alan, yes I can put some cycles into digging deeper with this one, 
> as you point out there's probably more that needs doing.
> As Alex found running the new testcase 400 times it failed once still, 
> interestingly during initial startListening() rather than the accept() 
> where it was failing before.
> On a general issue of "thread-safety", I had a good look through the 
> spec docs and architecture docs and couldn't find any specification of 
> thread-safety(or not), should it be inferred if the docs don't 
> specifically state "thread-safe" that it should be assumed as 
> "not-thread safe"?
>
> Thanks
> Andrew
>
> Andrew Leonard
> Java Runtimes Development
> IBM Hursley
> IBM United Kingdom Ltd
> internet email: andrew_m_leonard at uk.ibm.com
>
>
>
>
> From: Alan Bateman <Alan.Bateman at oracle.com>
> To: "serguei.spitsyn at oracle.com" <serguei.spitsyn at oracle.com>, Andrew 
> Leonard <andrew_m_leonard at uk.ibm.com>, 
> serviceability-dev at openjdk.java.net
> Date: 08/06/2019 10:12
> Subject: Re: RFR JDK-8225474: JDI connector accept fails "Address 
> already in use" with concurrent listeners
> ------------------------------------------------------------------------
>
>
>
> On 08/06/2019 05:53, serguei.spitsyn at oracle.com wrote:
> > Hi Andrew,
> >
> > It looks good to me.
> > Thank you for your investigation and taking care about this!
> I think this one needs further analysis as changing listenMap to be a
> CHM does not make this connector thread safe and doesn't address a
> number of other places where the map is accessed without
> synchronization. For example, startListening would need to be changed to
> use `putIfAbsent`, stopListening would need to use `remove` rather than
> get + remote. There are several others once you start looking at the
> sub-classes, e.g. SocketListeningConnector.updateArgumentMapIfRequired.
>
> At the API level, JDI does not require connectors to be thread safe. I
> agree it is desirable for some of the connector implementations to be
> thread safe, particularly ListeningConnectors as an obvious usage will
> be for a listener thread to hand off a VirtualMachine to another thread.
>
> Andrew - do you have cycles to investigate this further? I'm not opposed
> to changing the map to be a CHM but I think it needs further work.
>
> -Alan
>
>
>
>
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales with 
> number 741598.
> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/serviceability-dev/attachments/20190610/3fde7972/attachment-0001.html>


More information about the serviceability-dev mailing list