[JIRA] (JENKINS-60702) Two calls to the build function can trigger the same run

2020-01-08 Thread jenk...@mrozekma.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Michael Mrozek closed an issue as Not A Defect  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Never mind! After pawing through the code I discovered this is intentional behavior. I thought it had to be a bug because in my real job (not the simple test I posted in the description) I'm passing in different build parameters for the two calls, but due to an unrelated problem the target job wasn't actually declaring those parameters, so they got filtered out. This no longer affects me now that I've fixed the parameterization problem, but I will add that I'm not 100% sure this behavior makes sense. I assume there's a good reason for the build action folding mechanism, but if job A tells Jenkins to build downstream job B twice, I would expect Jenkins to build it twice.  
 

  
 
 
 
 

 
 Jenkins /  JENKINS-60702  
 
 
  Two calls to the build function can trigger the same run   
 

  
 
 
 
 

 
Change By: 
 Michael Mrozek  
 
 
Status: 
 Open Closed  
 
 
Resolution: 
 Not A Defect  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)  
 
 

 

[JIRA] (JENKINS-60702) Two calls to the build function can trigger the same run

2020-01-08 Thread jenk...@mrozekma.com (JIRA)
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 »