jenkinsci / lockable-resources-plugin

Lock resources against concurrent use
https://plugins.jenkins.io/lockable-resources
MIT License
86 stars 183 forks source link

Add timemout attribute to eliminate long stuck when resource is long time locked / reserved #668

Open mPokornyETM opened 2 months ago

mPokornyETM commented 2 months ago

What feature do you want to see added?

We have some jobst, that try to repair some nodes ... to eliminate possible multiple actions on the same node, we lock the nodes via LRM

When we try to check the node, need to wait until all other jobs are done. Thats fine, but when the jobs takes too long, and you start this chrono task again, it will increase the queue unnecessarry. Therefor it will be fine, to skipp locking, when it takes too long

something like

// lock node1 and wait max 1 hour
lock(resource : 'node1', timeout : 3600) { echo 'I am locked now') }

Upstream changes

No response

Are you interested in contributing this feature?

No response