Skip to content

Instantly share code, notes, and snippets.

@p0deje
Last active August 10, 2018 07:30
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save p0deje/880880422df00f4d9031e8cff3808db8 to your computer and use it in GitHub Desktop.
Save p0deje/880880422df00f4d9031e8cff3808db8 to your computer and use it in GitHub Desktop.
Restart all dead executros on Jenkins (use from Script Console)
def deadExecutors = Jenkins.instance.computers.collect { c ->
c.executors.findAll { !it.isActive() }
}.flatten()
deadExecutors.each { it.doYank() }
@bjmgeek
Copy link

bjmgeek commented Mar 30, 2017

Thanks, this worked well! All my hundreds of threads were dead due to a disk filling up.

@daniyel
Copy link

daniyel commented May 11, 2017

this script solved my problem as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment