jenkinsci / jenkinsci/nodelabelparameter-plugin
[JENKINS-18971] Triggering a build with a parameterized node label to run on the same node doesn't work in most cases because it will take an addition executor on the node.
- Dominant language
- Java
- Stars
- 28
- Forks
- 59
- Avg merge
- 1h 24m
- Merged PRs (30d)
- 3
Description
If you have a parametrized job that you attempt to use node lables with for spawning a prerequisite build that cannot run with other builds running on the same node,eg. a set of MSI installer tests, the down stream job has to run on a different node.
Example:
if I have a project in the following state.
JOB_NAME:test msi installer
NODE_NAME:the_node #only 1 executor.. nothing should be running when we are running an msi installer.
1rst build step:
trigger parameterized build:run_install
with:"Block until triggered projects"=True
with:node lable parameter
with: name=label
with: parameter=$NODE_NAME
When the root build is triggered, the first thing it will do is trigger a build on the sub project and wait for it to finish. However, when the sub build project, in the example run_install, starts running, it will take an additional executor on the node. This creates a hang which will go on forever or until the build times out or is canceled. The hang occurs because the sub job is waiting for an executor on the_node that is being taken by the job that kicked it off and is waiting for it to finish, the root job; a deadlock of resources. Jenkins should free up and then reserve executors for jobs that are running on the same node during the build process to fix issues like this.
---
Originally reported by rweber, imported from: Triggering a build with a parameterized node label to run on the same node doesn't work in most cases because it will take an addition executor on the node.
Raw content of original issue
If you have a parametrized job that you attempt to use node lables with for spawning a prerequisite build that cannot run with other builds running on the same node,eg. a set of MSI installer tests, the down stream job has to run on a different node.
Example:
if I have a project in the following state.
JOB_NAME:test msi installer
NODE_NAME:the_node #only 1 executor.. nothing should be running when we are running an msi installer.
1rst build step:
trigger parameterized build:run_install
with:"Block until triggered projects"=True
with:node lable parameter
with: name=label
with: parameter=$NODE_NAMEWhen the root build is triggered, the first thing it will do is trigger a build on the sub project and wait for it to finish. However, when the sub build project, in the example run_install, starts running, it will take an additional executor on the node. This creates a hang which will go on forever or until the build times out or is canceled. The hang occurs because the sub job is waiting for an executor on the_node that is being taken by the job that kicked it off and is waiting for it to finish, the root job; a deadlock of resources. Jenkins should free up and then reserve executors for jobs that are running on the same node during the build process to fix issues like this.
- environment:
ALL
Contributor guide
Assessment
This issue has not been assessed yet.