Azure / azure-dev

A developer CLI that reduces the time it takes for you to get started on Azure. The Azure Developer CLI (azd) provides a set of developer-friendly commands that map to key stages in your workflow - code, build, deploy, monitor, repeat.
https://aka.ms/azd
MIT License
402 stars 195 forks source link

azd.exe process hanging around after VS exit #4033

Closed mitchdenny closed 2 months ago

mitchdenny commented 3 months ago

This may be a solar flare but I was cleaning up some code on my cloud hosted DevBox and I noticed that azd.exe was running and had a handle open on my source folder:

image

I suspect this process was launched by VS, but VS wasn't running so perhaps it didn't clean itself up. I can't remember interacting with the VS publish features on this devbox though so I'm not entirely sure where it came from.

Filing an issue just in case others have seen it.

mitchdenny commented 3 months ago

image

Was definitely launched by VS.

rajeshkamal5050 commented 2 months ago

@anvillan @abpiskunov can you triage this for anything on VS side? cc @ellismg @weikanglim

anvillan commented 2 months ago

@rajeshkamal5050 @mitchdenny

I gave it a try but could not repro: the azd.exe process is always terminated along with VS.

Remember that VS starts the azd vs-server as soon as it detects the current project is an Aspire project. Thus, even if you do not perform and 'Deploy' related tasks, the azd.exe process should be started already.

I tried...

  1. Create Aspire project, add new Environment, Publish
  2. Running the project, stopping it
  3. Intentionally terminating the azd.exe process while VS is running, so we recover it
  4. Closing VS while we are in the middle of a (long running) RefreshEnvironment operation
  5. Terminating (kill process) VS IDE in the middle of a RefreshEnvironment and/or running the project

If you could find a way to repro it consistently, that would help to see if there is any issue

mitchdenny commented 2 months ago

Let's pencil it in as a solar flare for now.