OpenLiberty / liberty-language-server

The Liberty Config Language Server provides language server features for Liberty server configuration files through any of the supported client IDEs.
Eclipse Public License 2.0
5 stars 11 forks source link

Incorrect diagnostics "ERROR: cdi-4.0 is already included." #256

Closed scottkurz closed 9 months ago

scottkurz commented 9 months ago

With LCLS v2.1.1 in LTE 23.0.12 we sometimes get diagnostics like:
"ERROR: cdi-4.0 is already included." with the red X and underline in server.xml

I watched this happen in the debugger.

The problem centers around the same LibertyDiagnosticParticipant instance getting used across two threads, with a field holding the features: private Set<String> includedFeatures;.

This would seem to need to be refactored to use a local/stack variable.

I'm taking for granted there's nothing wrong with the high-level flow re: why we're calling diagnostics across 2 threads in the first place. I've no reason to think that's wrong, but let me know if anyone disagrees.