Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Endless diagnostic publishing when validation is disabled #1175

Closed
IdanHo opened this issue Feb 15, 2022 · 16 comments · Fixed by #1176
Closed

Endless diagnostic publishing when validation is disabled #1175

IdanHo opened this issue Feb 15, 2022 · 16 comments · Fixed by #1176
Labels
bug Something isn't working
Milestone

Comments

@IdanHo
Copy link

IdanHo commented Feb 15, 2022

After updating from version 0.18.2 (As part of the vscode-xml) extension the lemminx-linux binary is using 100% of my cpu. (Same behaviour with 0.18.3, 0.18.4, 0.19.0). I don't have a specific xml file to point to, since it does so as soon as I open a container, without opening any XML files. I don't have debug symbols, but after attaching with GDB, these are the locations of all the threads:
image

@angelozerr
Copy link
Contributor

You mean that you don't open some XML file? I have no idea why you have this problem.

@rgrunber @fbricon have you some idea?

@IdanHo
Copy link
Author

IdanHo commented Feb 15, 2022

I don't open any XML file. note that I'm running on the Remote - Containers extension connected to a CentOS 7 container. and that it happens on both Linux and WSL

@IdanHo
Copy link
Author

IdanHo commented Feb 15, 2022

Ah, after restarting the container it didn't happen, so it's likely left over from when I did open an XML file, but I created this example file:

<?xml version="1.0" encoding="UTF-8"?>
<test>
</test>

and as soon as I opened it, it started happening.

@angelozerr
Copy link
Contributor

And do you benefit with syntax validation?

@IdanHo
Copy link
Author

IdanHo commented Feb 15, 2022

I have this "xml.validation.enabled": false set if that's what you mean.

@angelozerr
Copy link
Contributor

Could you enable xml trace https://github.com/redhat-developer/vscode-xml/blob/master/docs/Troubleshooting.md#no-support-on-xml-file and share your trace please

I have this "xml.validation.enabled": false set if that's what you mean.

Ok but have you some XML features like completion, hover, linked editing range, etc?

@IdanHo
Copy link
Author

IdanHo commented Feb 15, 2022

Ok but have you some XML features like completion, hover, linked editing range, etc?

All of them seem to be loading forever.

@IdanHo
Copy link
Author

IdanHo commented Feb 15, 2022

Could you enable xml trace https://github.com/redhat-developer/vscode-xml/blob/master/docs/Troubleshooting.md#no-support-on-xml-file and share your trace please

I'm just seeing this on repeat:

[Trace - 10:04:25 AM] Received notification 'textDocument/publishDiagnostics'.
Params: {
    "uri": "file:///workspaces/repo/test.xml",
    "diagnostics": []
}

(As in, it's receiving this notification a bunch of times every second)

@angelozerr
Copy link
Contributor

I don't understand, if you set "xml.validation.enabled": false you should not have 'textDocument/publishDiagnostics'.

What is your trace when the language server is started?

@angelozerr
Copy link
Contributor

The impression that I have is that the language server started and (perhaps) the settings is not valid and doesn't take care of your enabled validation settings.

The server crashes and restart again. Not sure with that but it's an idea.

@IdanHo
Copy link
Author

IdanHo commented Feb 15, 2022

Attached is the startup trace
trace.log

@fbricon
Copy link
Contributor

fbricon commented Feb 15, 2022

@IdanHo do you use a specific container? Can you install a JDK in the container and point xml.java.home to it?

@angelozerr
Copy link
Contributor

@IdanHo thanks so much with your trace, I can reproduce the problem and I know how to fix it.

For the moment to avoid having this trouble, please set "xml.validation.enabled": true

@fbricon fbricon added the bug Something isn't working label Feb 15, 2022
@fbricon fbricon added this to the 0.19.1 milestone Feb 15, 2022
angelozerr added a commit to angelozerr/lemminx that referenced this issue Feb 15, 2022
Fixes eclipse-lemminx#1175

Signed-off-by: azerr <azerr@redhat.com>
@IdanHo
Copy link
Author

IdanHo commented Feb 15, 2022

For the moment to avoid having this trouble, please set "xml.validation.enabled": true

Thanks!

angelozerr added a commit to angelozerr/lemminx that referenced this issue Feb 15, 2022
Fixes eclipse-lemminx#1175

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit to angelozerr/lemminx that referenced this issue Feb 15, 2022
@angelozerr angelozerr changed the title 100% CPU Usage since version 0.18.3 Endless diagnostic publishing when validation is disabled Feb 15, 2022
angelozerr added a commit to angelozerr/lemminx that referenced this issue Feb 15, 2022
fbricon pushed a commit that referenced this issue Feb 15, 2022
Fixes #1175

Signed-off-by: azerr <azerr@redhat.com>
fbricon added a commit to fbricon/wildwebdeveloper that referenced this issue Feb 15, 2022
this fixes a couple security issues linked to downloading remote resources.
- eclipse-lemminx/lemminx#1171
- eclipse-lemminx/lemminx#1174

and a critical bug when validation is disabled, using 100% CPU:
- eclipse-lemminx/lemminx#1175
@fbricon
Copy link
Contributor

fbricon commented Feb 15, 2022

@IdanHo vscode-xml 0.19.1, which includes a fix for this issue, has been released to the VS Code Marketplace

mickaelistria pushed a commit to eclipse-wildwebdeveloper/wildwebdeveloper that referenced this issue Feb 15, 2022
this fixes a couple security issues linked to downloading remote resources.
- eclipse-lemminx/lemminx#1171
- eclipse-lemminx/lemminx#1174

and a critical bug when validation is disabled, using 100% CPU:
- eclipse-lemminx/lemminx#1175
@IdanHo
Copy link
Author

IdanHo commented Feb 16, 2022

@IdanHo vscode-xml 0.19.1, which includes a fix for this issue, has been released to the VS Code Marketplace

That update indeed fixed the issue, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants