Hi Brian,
I think lock works within steps and script block, however this doesn't help me. I need bigger to lock a node across several sequential stages to prevent it from being freed.
This is the use case:
Node1 and Node2 start working their parts of a stage in parallel. Parallel stages is used to, well parallelize workflow. End of first parallel block is a synchronization point (end of setup phase).
After this, nodes go into the second parallel block, where they do the testing (testing involves both nodes as a unit).
Nodes can finish phase1 at different speeds, and due to this Jenkins makes the node that is waiting on the other one available for other jobs (including a queued run of this same job). I want to prevent it from being available.
I hope I explained my use case more closely now.