jenkinsci / jenkinsci/lockable-resources-plugin
Lock management "by hand": example with early release of a lock
- Dominant language
- Java
- Stars
- 99
- Forks
- 205
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 8
Description
Hi,
I've a Jenkins job using pipeline and locks.
My Jenkinsfile looks like that:
```
[...]
lock(resource: 'mylock') {
parallel foo: stuff_for_foo, bar: stuff_for_bar
}
[...]
```
Of course, the lock is kept until foo and bar are both terminated.
I would like to know whether it's possible to release the lock as soon as one there is a failure (in either foo or bar).
Note: I'm aware of the "failFast" option of parallel step. However, I do not want to kill all branches in case of failure. Just to release the lock.
Is it possible to lock and release resources directly using API ? Perhaps using LockableResourceManager.lock(..) and LockableResourceManager.freeResources(...) programmatically ?
Any clue on this topic ?
Many thanks
Contributor guide
Assessment
This issue has not been assessed yet.