RFR: 8323670: A few client tests intermittently throw ConcurrentModificationException

Andrey Turbanov aturbanov at openjdk.org
Mon Jan 22 09:22:27 UTC 2024


On Mon, 22 Jan 2024 08:37:24 GMT, Tejesh R <tr at openjdk.org> wrote:

>> _all reads or writes to that object's variables are done through synchronized methods_
>> 
>> This is a key requirement. In your case you have added `synchronized` only to a method, which reads that object. But a writer is not `synchronized` in you case.
>
> As per my analysis `fileCache` is synchronized in other places also. Do you notice any places where it is not synchronized?

`synchronized` _works_ only if synchronized object is the same in all places. In the new method "synchronized object" - is an instance of `FilesLoader`, while in other places `fileCache` is accessed under `synchronized(fileCache)`.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/17462#discussion_r1461554583


More information about the client-libs-dev mailing list