microsoft / vscode-tye

A Visual Studio Code extension for Tye development
Other
25 stars 9 forks source link

An error occurs if shutting down the tye application after disconnecting all services #178

Open v-ruizh opened 2 years ago

v-ruizh commented 2 years ago

OS: Win10 Build Version: 20220211.2 Tye Version: 0.11.0-alpha.22111.1

Repro Steps:

  1. Download the application by the command "git clone https://github.com/pratiksanglikar/tye-demo.git" -> Open the application in VS Code.
  2. Select the "Debug with Tye" configuration and press F5 to start debugging.
  3. Click "disconnect" button to disconnect all services.
  4. Click "Shutdown" button to shut down the tye application.

Expect: There is no error when shutting down the tye application.

Actual: An error occurs when shutting down the tye application. (It will start debugging when shutting down the tye application.) test

More Info: This issue doesn't reproduce on Mac and Linux.

philliphoff commented 2 years ago

@v-ruizh Thanks for finding this! I was able to repro the error, while not on every try, enough to have an idea of what might be going on. I think, as Tye is shutting down, it's generating status events that show at least one process still running, which then get picked up by the watch task as processes that need auto-reattaching.

We don't have great hooks in VS Code to be able to tell when the user is "done" debugging (so as to stop the watch task). However, if the user specifically stops the application from the tree view, that's probably a place where we can definitively say that we should stop any existing watch task associated with that application.