borisbrodski / sevenzipjbinding

7-Zip-JBinding
http://sevenzipjbind.sourceforge.net/
Other
176 stars 50 forks source link

SevenZip.initSevenZipFromPlatformJAR() is not thread-safe #24

Open lasselindqvist opened 4 years ago

lasselindqvist commented 4 years ago

SevenZip.initSevenZipFromPlatformJAR() is not thread-safe in that it might fail it multiple threads run it simultaneously. My context for this is running tests concurrently and the tests use the bindings to read archives. The code that was used is not public, but I can try to provide an example Maven project for reproducing this, if this is something that should be supported.

How I have handled this in the mean time is by just adding one retry to the method if it fails. This makes it unlikely enough that both executions fail.