-
Notifications
You must be signed in to change notification settings - Fork 38
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
Panic when reading/writing to closed pipe #636
Comments
@sourishkrout how does the extension implement the "stop" button? We don't have a separate call so I assume that the gRPC stream does something to the existing client->server stream. |
From the logs it's clear that something like this happens:
I was able to reproduce it and it seems that the problem is with the fact that the signal is sent to the whole process group. The server process and its subprocesses (commands) are in the same process group. I will send a PR to disable sending a signal to the group. The drawback is that when the command has its own subprocesses, they may leak and become zombie. Also, we likely should fix the communication between the client and the server. The client should await a confirmation that the stop request was handled and close the connection only after that, or after a timeout. Otherwise, some command output might be missed. |
Consider the following solutions:
|
Here's how. Btw, this the same for Runner v1 vs v2 (not saying it's correct): https://github.com/stateful/vscode-runme/blob/main/src/extension/runner/index.ts#L635-L651 |
Runner v2 is still behind a experiment flag so we could make APIs changes any time. In fact, now is the time if API changes are required to make this work. |
Fixed in #637. |
This is super easy to reproduce from the extension with a non-interactive cell. Once started, you click the stop button (see video), the runme kernel server dies due to a panic with the stack:
Here's a log: https://gist.github.com/sourishkrout/ba1d6fac2fcdde464ec5a0bf4cbcb5e3
Screen.Recording.2024-07-23.at.3.35.10.PM.mov
The text was updated successfully, but these errors were encountered: