PureJavaSnappy is not thread-safe
Closed this issue · 0 comments
The Snappy
class maintains a single static instance of SnappyApi
[1].
PureJavaSnappy
has a table
member variable[2], which is mutated during compression operations[3,4,5,6].
Concurrent compression calls seem likely to corrupt each other.
[1] - https://github.com/xerial/snappy-java/blob/master/src/main/java/org/xerial/snappy/Snappy.java#L52
[2] - https://github.com/xerial/snappy-java/blob/master/src/main/java/org/xerial/snappy/pure/PureJavaSnappy.java#L16
[3] - https://github.com/xerial/snappy-java/blob/master/src/main/java/org/xerial/snappy/pure/PureJavaSnappy.java#L86
[4] - https://github.com/xerial/snappy-java/blob/master/src/main/java/org/xerial/snappy/pure/PureJavaSnappy.java#L102
[5] - https://github.com/xerial/snappy-java/blob/master/src/main/java/org/xerial/snappy/pure/SnappyRawCompressor.java#L119
[6] - https://github.com/xerial/snappy-java/blob/master/src/main/java/org/xerial/snappy/pure/SnappyRawCompressor.java#L172