Hi Carl,

I am also working on solving the same problem you had i.e. we do have 
agents who goes in lost_contact state because either they aren't 
bootstrapped properly or something like this, due to these agents the jobs 
running on them get stuck and never allow a chance to another jobs. We 
manually disable the host but the problem is when a job is scheduled in an 
agent which has lost_contact even that jobs are affected. I am trying to 
use APIs to look for agents whenever I schedule a job and if there are any 
agent with that status, I want to disable them and restart all the running 
and scheduled jobs.
Can you please let me know about what you have done.

Thanks
Mimansha

On Monday, April 27, 2015 at 5:44:33 AM UTC-7, Carl Reid wrote:
>
> Thanks to everyone who has helped me with this.
>
> To recap, I needed a way of automatically cancelling pipeline stages which 
> contained jobs scheduled for agents that were not responding (because they 
> had been turned off or in the case of AWS hosted agents, terminated).
>
> Using a a combination of API calls and some logic in PowerShell I now have 
> a task that periodically checks for "stuck" stages and cancels them, 
> allowing new pipeline runs.
> If anyone else is interested in how to do this let me know.
>
> Cheers
>
> Carl
>
>
>
>
> On Tuesday, 7 October 2014 15:03:36 UTC+1, Carl Reid wrote:
>>
>> We use workstations as additional build and test agents due to them 
>> having the correct software installed (Visual Studio) and being quite 
>> powerful machines.
>>
>> However since these are workstations users often turn them off! 
>>
>> When a pipeline job is set to run on all agents the pipeline schedule 
>> seems to include the agents of the machines that are turned off and never 
>> completes until the machine is brought back online. The problem with this 
>> is that a new execution of the pipeline will not start until the previous 
>> one has completed. This requires us to manually go into each pipeline and 
>> cancel the execution. Not a great situation especially when there are a 
>> large number of pipelines that this occurs on.
>>
>> My questions are:
>>
>>
>>    1. Is there a way of preventing GO from scheduling an "all agents" 
>>    job to NOT schedule the job for a non-responsive or missing agent?
>>    2. Is there a way of getting GO from timing out and cancelling the 
>>    pipeline scheduling for non-responsive or missing agents?
>>
>> I have tried setting the job timeout however this only seems to apply 
>> once a job has started. 
>>
>>
>> Thanks in advance.
>>
>> Carl
>>
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to