jenkinsci / jenkinsci/lockable-resources-plugin

lock not released

Open
#136 4 comments 0 reactions 0 assignees View on GitHub
resource conflicts or cleanup handled poorly Triage
Dominant language
Java
Stars
99
Forks
205
Avg merge
2d 13h
Merged PRs (30d)
8

Description

With Jenkins 2.176.1 and Lockable Resources plugin 2.5.

I've a pipeline job that use lock:

```
lock(resource: "${env.REPOPATH}-${params.TARGET_BRANCH}") {
/* a lot of code here */
}
```
It used to work perfectly.

Unfortunately, today, Jenkins said that a lock is NOT released. Some jobs are waiting for a resource ("my/private/repo-master").

Therefore, I started to investigate. I found that org.jenkins.plugins.lockableresources.LockableResourcesManager.xml contains the following lines:

```

my/private/repo-master


0
Tools_pipeline#2426
1560860553


```

The output of the job Tools_pipeline#2426 is the following:

```
...

[Pipeline] lock
Trying to acquire lock on [my/private/repo-master]
Found 0 available resource(s). Waiting for correct amount: 1.
[my/private/repo-master] is locked, waiting...
Lock acquired on [my/private/repo-master]
[Pipeline] { (show)
[Pipeline] // lock
[Pipeline] stage (show)
[Pipeline] End of Pipeline
[lockable-resources] released lock on [my/private/repo-master]
Finished: SUCCESS
```

According to this log, all is OK.
(I finally released the lock "by hand"; using "https://my.jenkins.url/lockable-resources/")

Any clue on that ?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.