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

Is the server-side push in Pylsp thread unsafe? #575

Open
WutingjiaX opened this issue Jun 28, 2024 · 0 comments
Open

Is the server-side push in Pylsp thread unsafe? #575

WutingjiaX opened this issue Jun 28, 2024 · 0 comments

Comments

@WutingjiaX
Copy link

WutingjiaX commented Jun 28, 2024

I have developed some business logic based on Pylsp (without modifying the logic related to WS). One of my business characteristics is that a didopen/didchange request may trigger a large number of server notifications.
But I found that there is a probability that it will cause the client to throw a 1002 error code, leading to the closure of the link.

If I make the interval of each notification longer(like sleep 0.1s) , this problem would not have occurred.

Under circumstances where there is a large number of pushes, by printing the thread number, I have indeed found that after a certain threshold(maybe 20?), it will switch from single-threaded to multi-threaded pushing.

@WutingjiaX WutingjiaX changed the title Is the code writing method for server-side push in Pylsp thread unsafe? Is the server-side push in Pylsp thread unsafe? Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant