davidB / scala-maven-plugin

The scala-maven-plugin (previously maven-scala-plugin) is used for compiling/testing/running/documenting scala code in maven.
https://davidb.github.io/scala-maven-plugin/
The Unlicense
560 stars 151 forks source link

fix: Handle race conditions when getting the compiler bridge #759

Closed acote-coveo closed 5 months ago

acote-coveo commented 5 months ago

It was identified in https://github.com/davidB/scala-maven-plugin/issues/738 that a race condition could occur when building a project using multiple threads.

To mitigate the issue, I wrapped the installation of the compiler with a synchronized block on the Static instance.

As a result, if multiple threads try to install the compiler at the same time, only one thread will be able to do so. When they will get unlocked, it will check if the file was created meanwhile and if so, to will early return.

acote-coveo commented 5 months ago

@slandelle When can we expect a release? I also noticed that the latest versions are not available on maven central

slandelle commented 5 months ago

As soon as I manage to fix the release. I suspect maven-gpg-plugin has changed the way things work...

slandelle commented 5 months ago

4.9.0 is online