Type: New Feature
Affects Version/s: 2.4.8
Fix Version/s: None
Ivy does not support concurrent access to its resolution cache
Grape relies on Ivy. For this reason, Grape cannot support concurrent access to its resolution cache neither.
When using the @Grab annotation in jenkins groovyCommand or systemGroovyCommand, the related code is vulnerable to race conditions. When the race condition appears in a systemGroovyCommand, we have no choice but to reboot jenkins as all consecutive calls to @Grab fail.
Among the two solutions we tried:
- Protect the calls to grab with a lock similar to ivy's "artifact-lock-nio" strategy. Works but slow.
- Set Ivy's lock on the repository cache and setup Grab to use a different cache resolution cache for each concurrent jobs. The following code permits to fix a test we did to reproduce the race condition.
We'd like to propose to add an additional argument to Grab to setup Ivy's resolution cache directory.
Note that this solution seems to have been adopted by these users too
Would you agree on such a feature ? We'd be glad to propose a PR.