Open XavierRaynaud opened 4 years ago
Implemented in #185
Just reading the original issue, I am trying to understand how the use-case fits with lockable resource concepts? If the resource represented a device, or some other token for dedicated use by some one consumer at a time, doesn't the surviving branch of your parallel job still need it (and need that someone else does not hijack it)? Otherwise, could there be separate resources for those separate branches?
Otherwise, as good an example as any for the optionally separated locking and unlocking activities.
Note for developer. Document how to unlock resource via LRM. Add there a notice that is potential risk. Maybe we shall add it also in groovy shared lib.
Hi,
I've a Jenkins job using pipeline and locks. My Jenkinsfile looks like that:
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