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

Kubernetes nodes sometimes reconnect after jobs complete, when configured to never reconnect

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • kubernetes-plugin
    • None
    • Kubernetes 1.20.11 on Oracle Cloud (OCI), Kubernetes plugin 1.30.4 on Jenkins LTS 2.289.3 on JDK 11.0.12 (both agent and master)

      Using Kubernetes 1.20.11, I am seeing jobs run successfully on Kubernetes agents; however, the Kubernetes plugin intermittently attempt to reconnect to the master after the job completes.

      Happy Path case:  (note the 'Disabled agent engine reconnects' line)

      ... job runs fine
       Nov 10, 2021 12:13:22 PM org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave$SlaveDisconnector call
       INFO: Disabled agent engine reconnects.
       Nov 10, 2021 12:13:22 PM hudson.remoting.jnlp.Main$CuiListener status
       INFO: Terminated
       [INFO tini (1)] Spawned child process 'docker-entrypoint.sh' with pid '7'
       [INFO tini (1)] Main child exited with signal (with signal 'Terminated')
       ...
       k8s terminates Pod (releasing resources), and deletes Pod
      

      Sad path case: (not there is no 'Disabled agent engine' line)

       ... job runs fine
       Nov 10, 2021 12:37:44 PM hudson.remoting.jnlp.Main$CuiListener status
       INFO: Terminated
       Nov 10, 2021 12:37:54 PM hudson.remoting.jnlp.Main$CuiListener status
       INFO: Performing onReconnect operation.
       Nov 10, 2021 12:37:54 PM hudson.remoting.jnlp.Main$CuiListener status
       INFO: onReconnect operation failed.
       ...
       (agent tries to reconnect to master; master rejects agent; agent exits with an error)
       ...
       k8s terminates Pod (releasing resources), but marks it as status Completed
       

          [JENKINS-67111] Kubernetes nodes sometimes reconnect after jobs complete, when configured to never reconnect

          Steve Roth created issue -
          Steve Roth made changes -
          Description Original: Using Kubernetes 1.20.11, I am seeing jobs run successfully on Kubernetes agents; however, the Kubernetes plugin intermittently attempt to reconnect to the master after the job completes.

          Happy Path case:  (note the 'Disabled agent engine reconnects' line)
          ... job runs fine
          Nov 10, 2021 12:13:22 PM org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave$SlaveDisconnector call
          INFO: Disabled agent engine reconnects.
          Nov 10, 2021 12:13:22 PM hudson.remoting.jnlp.Main$CuiListener status
          INFO: Terminated
          [INFO tini (1)] Spawned child process 'docker-entrypoint.sh' with pid '7'
          [INFO tini (1)] Main child exited with signal (with signal 'Terminated')
          ...
          k8s terminates Pod (releasing resources), and deletes Pod

          Sad path case: (not there is no 'Disabled agent engine' line)
          ... job runs fine
          Nov 10, 2021 12:37:44 PM hudson.remoting.jnlp.Main$CuiListener status
          INFO: Terminated
          Nov 10, 2021 12:37:54 PM hudson.remoting.jnlp.Main$CuiListener status
          INFO: Performing onReconnect operation.
          Nov 10, 2021 12:37:54 PM hudson.remoting.jnlp.Main$CuiListener status
          INFO: onReconnect operation failed.
          ...
          (agent tries to reconnect to master; master rejects agent; agent exits with an error)
          ...
          k8s terminates Pod (releasing resources), but marks it as status Completed
           
          New: Using Kubernetes 1.20.11, I am seeing jobs run successfully on Kubernetes agents; however, the Kubernetes plugin intermittently attempt to reconnect to the master after the job completes.

          Happy Path case:  (note the 'Disabled agent engine reconnects' line)
          {code}
          ... job runs fine
           Nov 10, 2021 12:13:22 PM org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave$SlaveDisconnector call
           INFO: Disabled agent engine reconnects.
           Nov 10, 2021 12:13:22 PM hudson.remoting.jnlp.Main$CuiListener status
           INFO: Terminated
           [INFO tini (1)] Spawned child process 'docker-entrypoint.sh' with pid '7'
           [INFO tini (1)] Main child exited with signal (with signal 'Terminated')
           ...
           k8s terminates Pod (releasing resources), and deletes Pod
          {code}

          Sad path case: (not there is no 'Disabled agent engine' line)
          {code}
           ... job runs fine
           Nov 10, 2021 12:37:44 PM hudson.remoting.jnlp.Main$CuiListener status
           INFO: Terminated
           Nov 10, 2021 12:37:54 PM hudson.remoting.jnlp.Main$CuiListener status
           INFO: Performing onReconnect operation.
           Nov 10, 2021 12:37:54 PM hudson.remoting.jnlp.Main$CuiListener status
           INFO: onReconnect operation failed.
           ...
           (agent tries to reconnect to master; master rejects agent; agent exits with an error)
           ...
           k8s terminates Pod (releasing resources), but marks it as status Completed
           {code}

            Unassigned Unassigned
            srothco Steve Roth
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: