[JIRA] (JENKINS-57338) Lockable resource didn't work, if two jobs acquires lock at same time

92 views
Skip to first unread message

beermichael@siemens.com (JIRA)

unread,
May 6, 2019, 4:10:12 AM5/6/19
to jenkinsc...@googlegroups.com
Beer Michael created an issue
 
Jenkins / Bug JENKINS-57338
Lockable resource didn't work, if two jobs acquires lock at same time
Issue Type: Bug Bug
Assignee: Unassigned
Components: lockable-resources-plugin
Created: 2019-05-06 08:09
Environment: Jenkins ver. 2.164.2
Lockable Resources plugin version: 2.5
Priority: Critical Critical
Reporter: Beer Michael

Lockable resource is used in the options block of the pipeline like this: 

options {
       timestamps()
       skipDefaultCheckout()
       lock resource: "Lock_Slave_${SlaveName.split(',').first()}"
       timeout(time: "$JobTimeout" as Integer, unit: "HOURS")
}

There are three jobs in the Jenkins System, which are using the same SlaveName (build with parameters parameter). All 3 jobs are started at the same time. After the first job is started, the other 2 jobs waits for the lock. After the job is done, the two other jobs acquires the lock at the same time. 

 

Console log job 1:

2019-05-02 10:23:55  Trying to acquire lock on [Lock_Slave_TIS_MainTargets]

2019-05-02 10:23:55  Found 0 available resource(s). Waiting for correct amount: 1.

2019-05-02 10:23:55  [Lock_Slave_TIS_MainTargets] is locked, waiting...

2019-05-02 11:05:58  Lock acquired on [Lock_Slave_TIS_MainTargets]

 

Console log job 2:

2019-05-02 10:24:52  Trying to acquire lock on [Lock_Slave_TIS_MainTargets]

2019-05-02 10:24:52  Found 0 available resource(s). Waiting for correct amount: 1.

2019-05-02 10:24:52  [Lock_Slave_TIS_MainTargets] is locked, waiting...

2019-05-02 11:05:58  Lock acquired on [Lock_Slave_TIS_MainTargets]

 

As you can see, the two jobs acquires the lock "Lock_Slave_TIS_MainTargets" at the same time. 

 

Get in contact with me if you need more information. Thanks in advance! 

 

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

ethorsa@inbox.lv (JIRA)

unread,
Jul 4, 2019, 4:21:02 AM7/4/19
to jenkinsc...@googlegroups.com
ethorsa commented on Bug JENKINS-57338
 
Re: Lockable resource didn't work, if two jobs acquires lock at same time

Can you check the log of the first build for a double release of the Lock? I recently had a build where the lock was released twice: At the end of the stage (as expected) and once more at the end of the pipeline.

Reply all
Reply to author
Forward
0 new messages