[
https://issues.apache.org/jira/browse/GROOVY-12565?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Scott Murphy Heiberg updated GROOVY-12565:
------------------------------------------
Description:
{{LspFixture}} records the client notifications in a
{{Collections.synchronizedList}} and plain lists. The server's debounced
compile thread adds to them while a test iterates them, e.g.
{{publishedParams*.uri}}, and the iterator of a synchronized list is not
synchronized.
{{GroovyLanguageServerTest.publishDiagnosticsIncludeVersionAndClearRemovedUris}}
failed on CI with a ConcurrentModificationException when the background
compile published during that read, after the publishing itself was serialized.
Fix: record into {{CopyOnWriteArrayList}}s, whose iterators read a snapshot.
PR: https://github.com/apache/groovy/pull/3094
was:
{{LspFixture}} records the client notifications in a
{{Collections.synchronizedList}} and plain lists. The server's debounced
compile thread adds to them while a test iterates them, e.g.
{{publishedParams*.uri}}, and the iterator of a synchronized list is not
synchronized.
{{GroovyLanguageServerTest.publishDiagnosticsIncludeVersionAndClearRemovedUris}}
failed on CI with a ConcurrentModificationException when the background
compile published during that read, after the publishing itself was serialized.
Fix: record into {{CopyOnWriteArrayList}}s, whose iterators read a snapshot.
> groovy-lsp LspFixture throws ConcurrentModificationException while the
> compile thread publishes
> -----------------------------------------------------------------------------------------------
>
> Key: GROOVY-12565
> URL: https://issues.apache.org/jira/browse/GROOVY-12565
> Project: Groovy
> Issue Type: Test
> Reporter: Scott Murphy Heiberg
> Priority: Major
>
> {{LspFixture}} records the client notifications in a
> {{Collections.synchronizedList}} and plain lists. The server's debounced
> compile thread adds to them while a test iterates them, e.g.
> {{publishedParams*.uri}}, and the iterator of a synchronized list is not
> synchronized.
> {{GroovyLanguageServerTest.publishDiagnosticsIncludeVersionAndClearRemovedUris}}
> failed on CI with a ConcurrentModificationException when the background
> compile published during that read, after the publishing itself was
> serialized.
> Fix: record into {{CopyOnWriteArrayList}}s, whose iterators read a snapshot.
> PR: https://github.com/apache/groovy/pull/3094
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)