[JIRA] (JENKINS-61387) SlaveComputer not cleaned up after the channel is closed

12 views
Skip to first unread message

zsy19980307@gmail.com (JIRA)

unread,
Mar 9, 2020, 4:54:03 AM3/9/20
to jenkinsc...@googlegroups.com
Shenyu Zheng created an issue
 
Jenkins / Task JENKINS-61387
SlaveComputer not cleaned up after the channel is closed
Issue Type: Task Task
Assignee: Unassigned
Components: kubernetes-plugin
Created: 2020-03-09 08:53
Priority: Major Major
Reporter: Shenyu Zheng

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.

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

zsy19980307@gmail.com (JIRA)

unread,
Mar 9, 2020, 4:59:02 AM3/9/20
to jenkinsc...@googlegroups.com
Shenyu Zheng commented on Task JENKINS-61387
 
Re: SlaveComputer not cleaned up after the channel is closed

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 implement this method. Maybe we need to implement `afterDisconnect` method to clean up SlaveComputer after the channel is closed?

zsy19980307@gmail.com (JIRA)

unread,
Mar 9, 2020, 4:59:02 AM3/9/20
to jenkinsc...@googlegroups.com

zsy19980307@gmail.com (JIRA)

unread,
Mar 9, 2020, 4:59:03 AM3/9/20
to jenkinsc...@googlegroups.com
Shenyu Zheng edited a comment on Task JENKINS-61387
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 implement this method.

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

zsy19980307@gmail.com (JIRA)

unread,
Mar 9, 2020, 6:27:02 AM3/9/20
to jenkinsc...@googlegroups.com
Shenyu Zheng edited a comment on Bug JENKINS-61387
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 implement override this method.


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

zsy19980307@gmail.com (JIRA)

unread,
Mar 9, 2020, 6:27:02 AM3/9/20
to jenkinsc...@googlegroups.com
Shenyu Zheng edited a comment on Bug JENKINS-61387
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?

jglick@cloudbees.com (JIRA)

unread,
Mar 17, 2020, 9:58:03 AM3/17/20
to jenkinsc...@googlegroups.com

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?

Reply all
Reply to author
Forward
0 new messages