RFR JDK-8155005: java.lang.reflect.Module.WeakSet is not thread-safe
Alan Bateman
Alan.Bateman at oracle.com
Mon Apr 25 12:58:34 UTC 2016
On 25/04/2016 12:13, Peter Levart wrote:
> Hi Alan,
>
> I created an issue for this:
>
> JDK-8155005: java.lang.reflect.Module.WeakSet is not thread-safe
>
> https://bugs.openjdk.java.net/browse/JDK-8155005
>
>
> I did what you suggested, renamed type parameters to <K1, K2, V>,
> split long line in Module and modified the test so that it now waits
> for entry to be expunged for up to 5 seconds when it is expected to be
> expunged but returns as soon as it detects that the entry is gone
> (usually in 1st 100 ms). It still waits just 500 ms when the entry is
> expected to remain in the map. False negatives should be eliminated
> this way and the test still doesn't waist plenty of execution time.
>
> Here's latest webrev:
>
> http://cr.openjdk.java.net/~plevart/jdk9-dev/Module.WeakSet.multithreadUnsafe/webrev.04/
>
I think using <K1, K2, V> makes it a lot more readable - thanks.
On gcAndWaitRemoved then I wonder if it would be more robust to have a
variant that polls indefinitely. 5s is a long time but with fastdebug
builds, maybe a looping thread or processes left over from a previous
test runs, virtual machines, then it might be long enough.
>
>
> If this is accepted then I would need to know via which repo this
> should be pushed (jdk9/dev or jake).
It should be okay to push this to jdk9/dev and we'll pull the changes
into jake. In general then we will be iterating on the module code for
some time and so will be using the jake sandbox for that.
-Alan
More information about the jigsaw-dev
mailing list