Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: ec2-plugin
    • Labels:
      None
    • Environment:
      ec2: 1.42
    • Similar Issues:

      Description

      Seeing EC2 agent on Linux that will stay connected for a good while and than suddenly get stuck on Connection terminated and never get cleaned up.

      This prevents new agents from being provisioned.

      I wrote this piece of groovy script to remove orphaned disconnected agents.
      Would this PR solve this issue? 

      import jenkins.model.Jenkins
      import hudson.plugins.ec2.EC2AbstractSlave
      
      println "Cleaning up offline EC2 slaves..."
      Jenkins.instance.slaves.each { node ->
        if(!(node in EC2AbstractSlave)) return
        def computer = node.getComputer()
        if (computer && !computer.isOffline()) return
        def logs = computer.getLog()
        if (!logs) return
        if (!"Connection terminated".equals(logs.readLines().last())) return
        println "Deleting ${node.name}"
        computer.doDoDelete()
      }
      
      null
      

        Attachments

          Activity

          There are no comments yet on this issue.

            People

            Assignee:
            thoulen FABRIZIO MANFREDI
            Reporter:
            jetersen Joseph Petersen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: