-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
CloudBees Jenkins Enterprise 2.32.2.1-rolling
lockable resources plugin version 1.x & 2.x
In strained situations, more resources than you asked for might get locked. This creates a bottleneck problem related to resources but it cannot be solved by adding more resources.
In worst cases will always lock all resources with a certain label instead of the required amount.
You can recreate the issue by configuring a couple (say 4) of lockable resources with a tag. Trigger a bunch of these jobs with NUM_RESOURCES between 1 - 4 to build up a queue of jobs waiting for their resources to become available. Eventually the error will start appearing.
properties([ parameters ([ string(name: 'NUM_RESOURCES') ]) ]); node { def askFor = params.NUM_RESOURCES as Integer lock(label: "FOO", quantity: askFor) { def clients = org.jenkins.plugins.lockableresources.LockableResourcesManager.class.get().getResourcesFromBuild(currentBuild.getRawBuild()) echo("Asked for ${askFor} resources, got ${clients.size()}: ${clients.toString()}") sleep (60 * 10) if (askFor != clients.size()) { error ("Wrong amount of resources acquired") } } }
- links to
Seeing this issue massively.
We have 9 labelled resources.
Build 1 reserves 4.
Build 2 reserves 4.
Build 3 wants to reserve 4, and waits.
Build 1 finishes and unlocks.
Now the bug: Build 3 locks 5, although in log it says it locks 4.
I'll happily play beta tester for a .hpi, this is bugging us quite much (we also often see builds reserve 4 to 5 when they only request 1, and this is really blocking)