Skip to content

Commit

Permalink
On Solaris, default LZF compress type (for transport) can cause segfault
Browse files Browse the repository at this point in the history
  • Loading branch information
kimchy committed Sep 5, 2013
1 parent 8c235dc commit f9234f9
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -24,6 +24,7 @@
import com.ning.compress.lzf.LZFEncoder;
import com.ning.compress.lzf.util.ChunkDecoderFactory;
import org.apache.lucene.store.IndexInput;
import org.apache.lucene.util.Constants;
import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.compress.CompressedIndexInput;
import org.elasticsearch.common.compress.CompressedStreamInput;
Expand All @@ -48,7 +49,11 @@ public class LZFCompressor implements Compressor {
private ChunkDecoder decoder;

public LZFCompressor() {
this.decoder = ChunkDecoderFactory.optimalInstance();
if (Constants.SUN_OS) {
this.decoder = ChunkDecoderFactory.safeInstance();
} else {
this.decoder = ChunkDecoderFactory.optimalInstance();
}
Loggers.getLogger(LZFCompressor.class).debug("using [{}] decoder", this.decoder.getClass().getSimpleName());
}

Expand Down

0 comments on commit f9234f9

Please sign in to comment.