-
Bug
-
Resolution: Unresolved
-
Major
Summary
Given a Declarative pipeline with a stage set to run on a node matching a particular label (in my case linux, if there is node connected, the Pipeline will pause as expected. Adding this label to a node should cause the job to proceed, but usually, the pipeline remains "stuck."
I don't know if this is specific to declarative, so I'm happy to move it to some other component.
Frequency of occurrence:
Maybe 50% of the time. There's no pattern apparent yet as to when it happens, or how to reliably trigger it.
Steps to recreate
1. Set up a remote build agent to have a label of other.
2. Create a Pipeline job, as in the below block. Note that the whole top level agent setting is for any, but there's a stage, called needs-a-labeled-agent, which relies on an agent matching the label linux:
pipeline { agent any stages { stage('first-stage') { steps { echo "Hello from Declarative." sh "mvn -version" sh "for i in `seq 1 5`; do cat /dev/urandom | env LC_CTYPE=c tr -dc \'[:alpha:]\' | head -c 100; done" } } stage ('needs-a-labeled-agent') { agent { label ("linux") } steps { sh "whoami" } } stage ('runs-on-any') { steps { echo "If we see this, we made it past the agent label thing" } } } // end stages post { always { echo "ALWAYS --> Runs all the time." deleteDir() } success { echo "SUCCESS --> Whatever we did, it worked. Yay!" } failure { echo "FAILURE --> Failed. Womp womp." } } }
3. Build this pipeline. It will get stuck at the needs-a-labeled-agent stage, which is expected, because we don't have an agent with that label.
4. Go to the Configure page for your remote agent, and replace the other label with linux. It'll look like this when done:
5. The pipeline build does not proceed. My expectation was that it would proceed - and I've seen it do so occasionally. But more frequently, it does not proceed.
6. Hover over the build queue, and you'll see a tooltip stating "Waiting for the next available executor on agent-69. Waiting for 10 minutes."
7. This can be recreated with a multibranch project as well - but the above described test case is way simpler to set up.
- is related to
-
JENKINS-66447 Clarify usage of multiple agents in declarative pipeline
- Open