-
New Feature
-
Resolution: Unresolved
-
Minor
-
None
It would be something like:
lock (resources: "my-res", timeout: 5) {
[real work here]
}
So it tries to lock the resource and give up after 5 seconds.
- is related to
-
JENKINS-48603 Add a 'nowait' option to the lockable resources plugin
-
- Open
-
-
JENKINS-61502 Option to (abort,mark unstable, queue) if resouce(s) are unavailable.
-
- Open
-
This would be fantastic.
My use case is in https://github.com/jenkins-infra/github-reports/ with two parallel blocks:
I am planning to combine a timeout for the entire pipeline with a lock around the long running command and inverse precedence, but it would be much nicer to be able to just skip this part of the pipeline if the resource is still locked.
AFAIUI, there's currently no way to check for the state of a lock (to combine with declarative "when" block), or timeout the wait for a lock, specifically.