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

Trace Server not stopped when deactivating extension during shutdown #13

Closed
bhufmann opened this issue Aug 15, 2023 · 0 comments · Fixed by #14
Closed

Trace Server not stopped when deactivating extension during shutdown #13

bhufmann opened this issue Aug 15, 2023 · 0 comments · Fixed by #14
Assignees
Labels
bug Something isn't working

Comments

@bhufmann
Copy link
Contributor

bhufmann commented Aug 15, 2023

The trace server is not stopped when running this extension with vscode/codium remote. I have noticed this behaviour in local install as well, but very rarely.

I did some investigation and with some logging (to file) I was able to confirm, that the deactivate() method of the vscode-trace-server is being called. However, the call to tree-kill(pid) has no effect. More investigation needed to fix stopping the trace server on exit.

I did some more digging to figure out what's going on. I think what's happening is that VsCode exits before the treeKill() command is executed. treeKill() spawns external processes to get all the children pids from the parent pid of the trace server launcher. It reads the stdout of the command ps -o pid --no-headers --ppid $ppid and then uses the collected list of pids to call process.kill on it. This is done in a callback, but the parent VsCode application already exited and the hence the no process is killed. I was able to make it work by adding some async/wait/timeout call to delay the execution.

Please note that this can also happen in the local case. I guess, that the shutdown of a local VsCode application takes longer than closing the remote processes.

Originally posted by @bhufmann in eclipse-cdt-cloud/vscode-trace-extension#173 (comment)

@bhufmann bhufmann changed the title > > > @williamsyang-work I noticed that when I close the remote vscode window, the server is not automatically stopped and keeps running afterwards. I had to go to a shell and kill the process. Do you see this behaviour as well? Trace Server not stopped when deactivating extension during shutdown Aug 15, 2023
@bhufmann bhufmann added the bug Something isn't working label Aug 15, 2023
@bhufmann bhufmann self-assigned this Aug 18, 2023
bhufmann added a commit to bhufmann/vscode-trace-server that referenced this issue Aug 18, 2023
bhufmann added a commit to bhufmann/vscode-trace-server that referenced this issue Aug 23, 2023
bhufmann added a commit to bhufmann/vscode-trace-server that referenced this issue Aug 23, 2023
bhufmann added a commit that referenced this issue Aug 23, 2023
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.

1 participant