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

abortTriggeredJob option in Parameterized Remote Trigger Plugin is not working

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • Jenkins: 2.375.3
      Parameterized Remote Trigger Plugin: abortTriggeredJob

      I noticed today that (parent) jobs that were manually aborted, or killed due to a timeout, did not actually also abort the remote triggered job. I then tested with a very simple call and caller pipeline to make sure there are no other interactions. Our "remote" Jenkins is actually the same environment, which just use this plugin because of the enhancedLogging feature.

      The pipelines which I used for testing have the following scripts:

      (I also have many variations, testing without blockUntilComplete, and instead using the handle to call the updateBuildStatusBlocking method, or any other combination of things that came to my mind. None of them worker, the triggered job was never aborted.)

      caller pipeline:

      pipeline {
          agent { label 'my-worker' }
          stages {
            stage('Hello') {
               steps {
                   echo 'Hello'
               }
            }
            stage('Call test pipeline') {
               steps {
                  script {
                      timeout(time: 10, unit: 'SECONDS') {
                        triggerRemoteJob abortTriggeredJob: true,
                                         job: 'test-call-pipeline',
                                         remoteJenkinsName: 'own-jenkins',
                                         blockBuildUntilComplete: true
                      }
                  }
               }
            }
            stage('World') {
               steps {
                  echo 'World'
               }
            }
         }
      } 

      to-be-called pipeline:

      pipeline {
          agent { label 'my-worker' }
          stages {
            stage('Hello') {
               steps {
                   echo 'Hello'
               }
            }
            stage('Sleep') {
               steps {
                  sleep 100000000
               }
            }
            stage('World') {
               steps {
                  echo 'World'
               }
            }
         }
      }

      For me the code here https://github.com/jenkinsci/parameterized-remote-trigger-plugin/blob/ef969679369894c5dd1bbb2502ae11023562f845/src/main/java/org/jenkinsci/plugins/ParameterizedRemoteTrigger/RemoteBuildConfiguration.java#L638-L652 looks quite okay, but I have no way of debugging it myself. Maybe there are only some try/catch clauses missing for AbortException and FlowInterruptedException?

            cashlalala KaiHsiang Chang
            stieglma Thomas
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: