lockable-resources-plugin
lockable-resources-plugin copied to clipboard
fix for JENKINS-64127 (ConcurrentModificationException from lock step)
See https://issues.jenkins-ci.org/browse/JENKINS-64127
Using synchronized on a method only ensures that there won't be 2 invocations of that method over the same instance.
It does not protect the field used inside this method.
I replaced the type of resources from an ArrayList into a concurrent collection.
I still kept the List type in org.jenkins.plugins.lockableresources.LockableResources#getResources since I wasn't sure about the impacts.
We have the same issue ever since we started using this plugin heavily with on-demand created resources.
No more needed. Most (hopefully all) concurrent modification exceptions are fixed noe