Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-61387

SlaveComputer not cleaned up after the channel is closed

    Details

    • Similar Issues:

      Description

      Steps to reproduce:

      1. Create a Pipeline with the fellow script
        pipeline{
            
            agent {
                label "test-pod"
            }
            
            stages {
                stage("Sleep") {
                    steps {
                        sh "sleep 1000"
                    }
                }    
            }
        }
        
      1. Run the Pipeline and waiting for agent pod to start
      2. Reboot the node which the agent pod has been assigned to

      Result:

      SlaveComputer is marked as offline and never get deleted even after we delete the pod. Build will also not failed and run forever.

      Expected Result:

      SlaveComputer is deleted and the build is failed.

       

        Attachments

          Issue Links

            Activity

            Hide
            cizezsy Shenyu Zheng added a comment - - edited

            I have looked at the codes.

            After the channel is closed, SlaveComputer will call `afterDisconnect` to notify KubernetesLaunch https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/slaves/SlaveComputer.java#L625. But KubernetesLaunch didn't override this method.

            Maybe we need to implement the `afterDisconnect` method in KubernetesLaunch to clean up SlaveComputer after the channel is closed?

            Show
            cizezsy Shenyu Zheng added a comment - - edited I have looked at the codes. After the channel is closed, SlaveComputer will call `afterDisconnect` to notify KubernetesLaunch https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/slaves/SlaveComputer.java#L625 . But KubernetesLaunch didn't override this method. Maybe we need to implement the `afterDisconnect` method in KubernetesLaunch to clean up SlaveComputer after the channel is closed?
            Hide
            jglick Jesse Glick added a comment -

            Hmm, this is supposed to have been addressed by a patch towards JENKINS-49707. See test case. Can you check with fine logging on org.csanchez.jenkins.plugins.kubernetes.pod.retention.Reaper?

            Show
            jglick Jesse Glick added a comment - Hmm, this is supposed to have been addressed by a patch towards JENKINS-49707 . See test case . Can you check with fine logging on org.csanchez.jenkins.plugins.kubernetes.pod.retention.Reaper ?

              People

              • Assignee:
                Unassigned
                Reporter:
                cizezsy Shenyu Zheng
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: