jenkins_api_client icon indicating copy to clipboard operation
jenkins_api_client copied to clipboard

Check if build is likely stuck

Open roya opened this issue 9 years ago • 0 comments

Hi We had issues in production where running jobs gets stuck and had to be stopped instantly, otherwise the whole master gets stuck.

I am doing something like this for each @client.job.list_by_status('running')

def is_job_stuck?(job_name) url = "#{@jenkins_master_url}/job/#{job_name}/lastBuild/api/xml?depth=1" return xml.xpath("//matrixBuild/executor/likelyStuck").text == 'true' end using this method made our production server much more stable and it would be great if you added this functionality.

BTW, great job!

roya avatar Jun 07 '15 08:06 roya