eclipse-equinox / p2

Eclipse Public License 2.0
15 stars 41 forks source link

Synchronize on the manager in RepositoryHelper#createMemoryComposite #415

Closed laeubi closed 10 months ago

laeubi commented 10 months ago

Currently the RepositoryHelper#createMemoryComposite uses the current time millis to generate a "unique" URI, but this has several issues:

Two threads can enter the method at the same time and then see that this "unique" id is currently not taken and then get the same id. It can even happen that both try to create them at the same time, what then will result in a provision exception what will return null and results in no composite created at all.

This do the following to mitigate this:

github-actions[bot] commented 10 months ago

Test Results

       9 files  ±0         9 suites  ±0   29m 51s :stopwatch: +59s 2 181 tests ±0  2 177 :heavy_check_mark: ±0    4 :zzz: ±0  0 :x: ±0  6 633 runs  ±0  6 622 :heavy_check_mark: ±0  11 :zzz: ±0  0 :x: ±0 

Results for commit a5652b69. ± Comparison against base commit ba8f64a9.