2

I have set up a multi-agent job for an Azure Release Pipeline. There are two agents in the agent pool. The job needs to be executed by every agent in the agent pool.

Multi-agent job

The settings shown in the above schedule two agent jobs whenever a release is triggered. If both agents are idle while the deployment starts, everything works as expected and both agents execute the job. But, as soon as one agent is busy at that time the behavior becomes unexpected and both jobs are executed by the same agent consecutively.

Agent job 1 Agent job 2

How can I ensure that every agent of the agent pool is executing the defined agent job?

millokeller
  • 252
  • 2
  • 12
  • We're going to need more info. Which part of this is relevant to you? https://learn.microsoft.com/en-us/azure/devops/pipelines/licensing/concurrent-jobs?view=azure-devops – Train Aug 07 '19 at 13:19
  • I am using two self-hosted agents assigned to the same agent pool. How can I provide you more information that is relevant to the question? What exactly do you need to know? – millokeller Aug 07 '19 at 13:49
  • Sorry I misunderstood the question. I misread `as soon as one agent is busy at that time the behavior becomes unexpected and both jobs are executed by the same agent consecutively` it makes more sense. – Train Aug 07 '19 at 14:01
  • Each job consumes a parallel job that runs on an agent. When there aren't enough parallel jobs available, the jobs are queued up and run one after the other. That's why it uses the same agent. Enough agents need to be available at the time off execution or it's gonna queue it to the same agent. – Train Aug 07 '19 at 14:05

1 Answers1

0

This is as designed. If one agent pool has two agents A and B, while A is busy, the build job will running with B. So in pool, if some agents are busy, the pipeline will running with other free and available agent.

The precondition of Parallel job is that you must has enough agents free and available. That's why as soon as one agent is busy at that time the behavior becomes unexpected.

Mengdi Liang
  • 17,577
  • 2
  • 28
  • 35