On Fri, 26 Jan 2024 22:57:49 GMT, Sergey Bylokhov <[email protected]> wrote:

> > I don't think we are able to trace it out, since the issue intermittent and 
> > previously I had made a copy of the vector list before checking for 
> > equality of the list. There was again an issue in the code which I used to 
> > copy to a temporary vector. So now instead of using` AbstractList.equals` 
> > I'm using iterators and comparing every element within synchronized method.
> 
> I think we should start investigating this one, probably by adding special 
> delays/asserts into the JDK to track down on what threads the data is 
> modified and used.

According to my analysis above, there there are two threads. (The third thread 
is also possible if `validateFileCache` is called not on EDT.) The only thread 
that modifies `fileCache` is EDT with `DoChangeContents`. Then the 
`ShellFolder` thread reads from `fileCache` *without synchronisation*, which 
allows the contents of `fileCache` to be modified concurrently.

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

PR Comment: https://git.openjdk.org/jdk/pull/17462#issuecomment-1912818487

Reply via email to