microsoft / azure-pipelines-agent

Azure Pipelines Agent 🚀
MIT License
1.72k stars 866 forks source link

[BUG]: Running multiple self-hosted agents causes improper Windows Server shutdown #4970

Open mjstrom opened 2 months ago

mjstrom commented 2 months ago

What happened?

I have a dedicated vm server that runs multiple pipeline agents. When restarting the server, if there is more than one agent running, the agents appear to hang on shutdown and prevent a clean operating system restart. It seems as if there is some shared resource that all of the agents are waiting on that is preventing a clean shutdown.

The same setup using the 2.x agents works without issue.

What did you do?

  1. Install multiple build agents on the same windows server. On this particular server I have 4 agents configured.
  2. Start all of the agents and verify that that that are functioning correctly.
  3. Restart the window server.

What happened?

What did you expect to happen? All of the agents should shutdown cleanly when the server restarts.

Other scenarios

Other notes

Versions

3.238.0 / Windows x64 3.243.1 / Windows x64

Environment type (Please select at least one enviroment where you face this issue)

Azure DevOps Server type

Azure DevOps Server (Please specify exact version in the textbox below)

Azure DevOps Server Version (if applicable)

Azure DevOps Server 2022.2 (AzureDevopsServer_20240702.1)

Operation system

Windows Server 2019 / Version 1809 (OS Build 17763.6189)

Version controll system

Azure DevOps Server git

Relevant log output

[2024-08-29 14:07:15Z INFO MessageListener] Sent GetAgentMessage to keep alive agent 85, session 'ac144eee-740a-4e97-93e5-aa1439cd7cef'.
[2024-08-29 14:07:37Z INFO HostContext] Agent will be shutdown for UserCancelled
[2024-08-29 14:07:37Z WARN VisualStudioServices] GET request to https://<redacted>/tfs/_apis/distributedtask/pools/9/messages has been cancelled.
[2024-08-29 14:07:37Z INFO MessageListener] Get next message has been cancelled.
[2024-08-29 14:07:37Z INFO JobDispatcher] Shutting down JobDispatcher. Make sure all WorkerDispatcher has finished.
[2024-08-29 14:07:37Z INFO AgentProcess] Agent execution been cancelled.
DenisNikulin5 commented 2 months ago

Hi @mjstrom thanks for reporting! We are working on more prioritized issues at the moment, but will get back to this one soon.