7:53 PM
0
Q: Azure Pipelines that share an Agent Pool are stealing the agent from each other, cancelling builds

guildsbountyWe are running into a strange issue with our DevOps server that I've not been able to find an answer to. We have several pipelines that are set up for different branches, all running off of a single job pool with a single Build Agent. The pipelines are set up for running Gated Check-ins for each ...

 
Adding either yaml or screenshots of gated check-in settings will help a bit.
 
@dropoutcoder Added them in
 
Thank. I am not seeing anything strange. I will try to simulate in my DevOps.
When did you created those gated builds? I was trying to create new through classic editor and the screen is different. I am wondering if the problem might not be the version of classic pipeline.
 
@dropoutcoder The gated checkin build for 'Trunk' (the one I shared) was originally created in 2017. However, another branch's gated build was created 2/13/2024, and its screens look the same. This is running on DevOps server 2020, Update 1.1
 
Didi you try to set system.debug to true under variable tab? It might give you extensive info about what is going on there.
 
7:53 PM
Only relevant error I seem to be getting is this: "MSB5021: Terminating the task executable "sgen" and its child processes because the build was canceled." Which is clearly pretty useless, as that's just MSBuild telling me that it's shutting off because something hit cancel. (It doesn't always terminate on the same executable, either--depends on timing for when it cancels). Some setting, somewhere, is allowing Branch A to cancel builds for Branch B (or v/v) when a new check-in happens
 
Can you try to set cancelTimeoutInMinutes to a higher number? More than the build is usually running. This one instructs how long to wait for task to wait if those are set to run always, but build is cancelled.
 
I've seen this issue happen 20 seconds into a build. It always perfectly lines up with when a new build is queued. And it's already a higher number than the build usually runs for--the builds average about three and a half minutes.
 
Okay. I am just spitballing now. I can't see anything wrong in what you have shared.
 
Yeah, that's fair...I can't seem to find this issue showing up anywhere else. Also, I just remembered that I didn't put this in the original question and it's probably important...this issue only showed up when we upgraded versions of our DevOps server. I can't remember if we were going from 2018 or 2019 (I asked someone who would know), but this issue just appeared after we upgraded.
I'll edit that into the original question once I get a concrete answer.
 
Okay, that might be a reason why it started to behave differently.
 
7:58 PM
Well, I guess that's a problem for tomorrow--time for me to duck out. Thank you for helping me look into this!
 
What I can say now is that there is something called Exclusive Lock, that actually can limit concurrent resource usage. That actually might be a reason the build is cancelled once new build started.
Sure thing. How tomorrow will be better day and issue gets solved. GN
How = Hope