Hello folks! I am trying to use locks in a fairly large matrix project configured using jenkins pipeline. I am trying to use a lock around a step which after release may not immediately acquired. Does the lockable resource get destroyed once it becomes unreferenced?
My pipeline code is somewhat like this
pipeline {
matrix
name: OS
values: "A", "B", "C"
agent { label "mylabel" } //one node with this label
stage 1 // takes 10s
stage 2 // takes 10s (has lock(label: 'tmplock') )
stage 3 // takes 10s
}
Iām running into java.lang.IllegalArgumentException: The label does not exist: tmplock
. Am I correct in thinking that once āAā is processed by stage 2, and is not waiting to be acquired, jenkins deletes it and throws this error?