job-dsl-plugin icon indicating copy to clipboard operation
job-dsl-plugin copied to clipboard

Fix problem with running the DSL in multiple threads

Open marc-guenther opened this issue 9 years ago • 10 comments

We use GPars eachParallel() to split up generation of jobs into multiple threads. This significantly reduced our run time from 25min to 5min.

Unfortunately, it leads to a race condition, which causes random jobs to be lost (and deleted) on each run.

Ultimately, it all boils down to this non thread-safe statement in JobParent.processItem(): referencedJobs << job

Making the 5 collections asSynchronized() fixed the problem for us.

marc-guenther avatar Feb 17 '16 19:02 marc-guenther