Title: Message Title
Michael Mrozek created an issue
Jenkins / JENKINS-60702
Two calls to the build function can trigger the same run
Issue Type:
Bug
Assignee:
Unassigned
Components:
pipeline-build-step-plugin
Created:
2020-01-08 22:14
Environment:
Jenkins 2.211 Pipeline: API 2.38 Pipeline: Build Step 2.11
Priority:
Minor
Reporter:
Michael Mrozek
I'm not certain which component is responsible for this, so I went with the Pipeline Build Step plugin. When using build to trigger another job, there seems to be a race condition where two calls to the function at approximately the same time with the same target job can both "start" the exact same run. For example, this code (the target job is irrelevant, I just happened to have an empty Freestyle job hanging around to test with):
parallel (
First : { build job: "Test/Freestyle", wait: true },
Second: { build job: "Test/Freestyle", wait: true },
)
causes the following:
Branch event
Obtained Jenkinsfile from 9c8963507d90d9cc4c8acb030efa07ca8a7d8d25
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] Start of Pipeline
[Pipeline] parallel
[Pipeline] { (Branch: First)
[Pipeline] { (Branch: Second)
[Pipeline] build
Scheduling project: Test » Freestyle
[Pipeline] build
Scheduling project: Test » Freestyle
Starting building: Test »