-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Dispose orphaned progress notifications behind when using progress reporting in language servers #16750
Comments
@joyceerhl Can you look for the stack from one of the extension host logs that might have more detail on where the crash occurred? /cc @jakebailey is there a any additional logging you need here. |
+1 |
The log message and the python language server logs indicate that this is not Pylance, but MPLS (crashing with a stack overflow. |
@jkryanchou We have recently released a new and more performant language server called Pylance which likely solves these issues you are reporting. You can download Pylance from the marketplace and install it alongside the core Python extension. Because our team's development efforts have shifted to support the new language server, we'd encourage you to try it out. If you try out Pylance and this issue persists, you can open an issue on the pylance-release repo. |
I have "python.languageServer": "Pylance", and the Pylance extension is installed. I'm still getting the Python Tools server crashing. |
The language server must be getting set somewhere else; does the UI also say that its Pylance or Default? |
Ah thanks, Jupyter repo workspace settings still say Microsoft. I'd expect the in progress notification that is presumably put up by the Python extension to be disposed if the server crashes though. |
I don't know why those are even showing up there; the API that runs those puts the message at the bottom bar of the editor, not as a real notification. Unless opening it manually brings that up? |
Ah, I see. The LS typically controls the start and end, but I guess the client should register something that stops this if the LS exits or something. But, I'd also argue that if the LS is crashing, there's a worse problem than some stale notifications; if it crashes once, it's likely going to crash again when it gets restarted. |
From the extension side all we can do is dispose of all notifications related to Microsoft language server. As we'll be getting rid of it once we remove old LS I don't see much point of keeping this issue open. |
This same API is used for pylance for its progress messages (though it uses them less), so it's technically still a problem. |
Can you point to the places where Pylance uses progress notifications in our repo? I'm unable to repro it in Pylance. |
https://github.com/microsoft/vscode-python/blob/3698950c97982f31bb9dbfc19c4cd8308acda284/src/client/activation/progress.ts is the implementation, shared between all LSs. Pylance only displays a progress message if you have the diagnostic mode set to "workspace" (where it takes more time to typecheck the entire workspace), but unless you're in a large project, you're not going to see it as Pylance is too quick to have the message up for a long time (unlike MPLS). |
But, I'm actually not sure if we use this in Pylance anymore, now that I think about it. Progress reporting got added to the LSP itself, so we may be using that. I'll check. |
No, we're still using this API in Pylance, so it could feasibly affect us. I haven't seen anyone hit it, though. |
Got it, I guess we should be calling vscode-python/src/client/activation/progress.ts Lines 37 to 43 in db8e1e2
Although the API |
Hi I'm interested in sending a PR for this |
@druuuu great! I assigned you to the issue 😊 |
Please assign this bug. |
H @Kavvyashre1395, since it's been one month since OSD I'm removing you as an assignee. You can still feel free to submit a PR to this issue if you'd like, but we're going to leave it open for other contributors too. |
Environment data
python.languageServer
setting: XXX[NOTE: If you suspect that your issue is related to the Microsoft Python Language Server (
python.languageServer: 'Microsoft'
), please download our new language server Pylance from the VS Code marketplace to see if that fixes your issue]Expected behaviour
Language server shouldn't crash. If it does progress notifications should be disposed
Actual behaviour
Steps to reproduce:
[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]
Logs
pylance.log
python.log
The text was updated successfully, but these errors were encountered: