Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ELS: Why workspace/configuration is called every time even if we do nothing? #523

Unanswered
angelozerr asked this question in Q&A
Discussion options

When I start ELS in IJ with LSP4IJ and I do nothing, I see that there are a lot of request 'workspace/configuration' which takes few CPU:

[Trace - 10:21:33] Received request 'workspace/configuration - (10000)'
Params: {
 "items": []
}
[Trace - 10:21:33] Sending response 'workspace/configuration - (10000)'. Processing request took 0ms
Result: []
[Trace - 10:21:38] Received request 'workspace/configuration - (10000)'
Params: {
 "items": []
}
[Trace - 10:21:38] Sending response 'workspace/configuration - (10000)'. Processing request took 0ms
Result: []
[Trace - 10:21:43] Received request 'workspace/configuration - (10000)'
Params: {
 "items": []
}
[Trace - 10:21:43] Sending response 'workspace/configuration - (10000)'. Processing request took 0ms
Result: []
[Trace - 10:21:48] Received request 'workspace/configuration - (10000)'
Params: {
 "items": []
}
[Trace - 10:21:48] Sending response 'workspace/configuration - (10000)'. Processing request took 0ms
Result: []
[Trace - 10:21:53] Received request 'workspace/configuration - (10000)'
Params: {
 "items": []
}
[Trace - 10:21:53] Sending response 'workspace/configuration - (10000)'. Processing request took 0ms
Result: []

I wonder why ELS does that? Why not reading just the configuration one time?

You must be logged in to vote

Replies: 2 comments 1 reply

Comment options

A language client, i.e., an editor, usually starts the language server as a child process. When the editor crashes for some reason, the language server may not be killed and may remain. In fact, this rarely happens when VSCode hangs.
Therefore, ELS periodically communicates with the client to check if the editor is still alive. The workspace/configuration request is the way to do this. By default, ELS automatically shuts down if there is no response from the client for 10 seconds.

You must be logged in to vote
1 reply
Comment options

Thanks for your great explanation!

This usecase can occur with any language server and we had the similar problem with your language servers written in Java XML language server and Java language server and to fix this issue we use the pid received in the LSP initialize parameters and check if the process is still alive by using ParentProcessWatcher.java

On windows it is not perfect because the cmd tasklist can take some CPU (see code line at https://github.com/eclipse-jdtls/eclipse.jdt.ls/blob/cbb11e0b64d03cff719576f88920af3a7e62b117/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/ParentProcessWatcher.java#L91). See discussion at eclipse-lemminx/lemminx#328

I wanted just to share with you how we cover this issue.

Comment options

Thank you for sharing the information. I've reported this as a code issue.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /