Cancel/Fail job if no suitable agents found Follow
Is there a way to cancel or fail a job if no suitable agents are found instead of leaving it in the queue? I have projects with jobs that are optional. These analyze data from mobile devices, they are nice to have, but the hosts are a little flaky. Currently if a host disconnects the mobile job stays in the queue, blocking other jobs from running. I would prefer that for these jobs if no suitable agent is found that the job is automatically marked as canceled or failed. This would allow other dependent jobs to run, I can handle dependencies that fail, or are canceled.
Please sign in to leave a comment.
I don't know of a way to cancel a single build in a chain, based on agent availability. You may need to use more than one chain to account for the occasions when suitable agents are available. Perhaps you could come up with a query to find any suitable agents using the REST API with another build configuration and then queue up a build based on that result. Is the case that suitable agents exist but they are sometimes in use and you don't want to wait for them to become available? Or is the case a suitable agent won't exist and it holds up the whole build chain?
It's more the case that one or two of our hosts are flaky.
I'm doing some performance benchmarking of applications across several platforms. The way the projects are setup I need to run multiple jobs in order on the same host. So for a given test one job chain has to be associated with one specific host.
Maybe there is a way that you could start your tests on all of the hosts from the same build configuration. How are you currently initiating a test on each platform?
It's just a schedule trigger. A single test benchmarks the server and clients on multiple platforms. Using one mobile host won't really impact the server. So I've set it up so that if problems cause a mobile host to fail the test will complete. Also, that means I need to have other client job chains running to place a load on the server. But if I have mobile host capacity for a run, I might as well use it.
The schedule trigger starts several job chains to run at the same time. Step timings across the chains are a little different so I have a setup job for each host, this gives me more control over how and when jobs are ran. But this also means if a host is missing then other chains are prevented from running because of queued dependencies.