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

timeout is not able to successfully terminate a process in Windows ephemeral agents

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • kubernetes-plugin
    • None

      When using this kind of pipeliine:

      pipeline {
        agent {
          kubernetes {
            yaml """
      apiVersion: v1
      kind: Pod
      spec: omitted for brevity
      """
          }
        }
      
        stages {
          stage('Timeout'){
              options {
                  timeout(time: 10, unit: "SECONDS")
              }
              steps{
                  container('jnlp') {
                      script{
                          try {
                              bat 'ping 127.0.0.1 -n 3601 > test.txt'
                          } catch(Exception ex) {
                              println("Exception")
                          } finally {
                              println("Finally")
                          }
                      }
                  }
              }
          }
        }
      }

      The job is aborted due to timeout, but is still running.

      As a workaround, I removed `container('jnlp')` to use the default one. That fixed the issue.

      That might be related to this unit test:  https://github.com/jenkinsci/kubernetes-plugin/blob/c52deaa6011df34e125ffb5d3f08b58874859b41/src/test/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/KubernetesPipelineTest.java#L754C17-L754C38

       

            rarabaolaza Raul Arabaolaza
            jmdesprez Jean-Marc Desprez
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: