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
internal: convert unwrap to except and add a debug log #15217
Conversation
I believe this is intentional. The receiver for the given sender dropping before the server has properly exited smells like a bug by the consumer of lsp-server. The receiver shouldn't be dropped before. |
It did seem intentional yes. However, this has happened on multiple stable versions of VSCode as a receiver. I assume they implemented the protocol correctly. Wouldn't it be better if this did not crash the server and logged an error instead ? Missing a notification does not seem fatal. Is it possible for the receiver to be overwhelmed by the amount of notifications sent from the server? I imagine this would cause it to skip notifications and cause this error as well. |
Well, if the unwrap panics then that means the receiver has been dropped at which point no more messages can be sent over that channel anyways (no matter whether we panic or ignore the result).
The channel is created with a capacity of 0 meaning that any send operation will block until the receiver has received it. |
Ok ok so overwhelming the receiver is off the table.
Ah right so nothing can be done from this point, I see. Thank you very much for answering my questions and looking into the PR! |
We could change it to an |
Can you remove the merge commit from the history here? Or just squash the commits into one |
188cba6
to
d9e9ca2
Compare
Sorry about that, should be all good now 👍 |
Thanks |
☀️ Test successful - checks-actions |
Remove an unsafe unwrap that can cause crashes if the value is a
SendError
.This is my first PR on this repo, please let me know if there is anything I can improve or details I can provide.