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

When condition requires executor allocation

XMLWordPrintable

      The when condition currently requires an executor to be allocated. This can result in being stuck waiting on an executor when the stage ends up never running. This mostly comes into play for stages that require a specific agent.

      pipeline {
         agent none 
         stages {
             stage('some-stage') {
                 agent any
                 when { expression { false } }
                 //stuck waiting on agent
            }
         }
      }
      

      I'm not sure of a good solution for this as there are legitimate use cases for wanting an agent as expression evaluation time. The only direct workaround is agent allocation in steps, but then you can't leverage post blocks.

            abayer Andrew Bayer
            rpocase Robby Pocase
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: