When trying to delete an already deleted object, Riak returns a 404 response with a text/plain body - "not found". However, this response MIGHT have a "Content-Encoding: gzip" header (and non-compressed body still). Trying to decompress the payload of such response leads to an internal java.util.zip.ZipException: Not in GZIP format exception in the riak client's http pipeline.
How to reproduce
It has proved to be almost impossible to easily reproduce that behaviour with curl.
But a test scenario in RiakGzipSpec.scala submitted together with the #40 pull request triggers this behaviour in ~75% runs on my machine.
Workaround
As a workaround, we may want to not fail response decompression directive in case of a ZipException, but just proceed with payload as it is. ( yes, it does sound ugly :) )
Problem
The optional gzip compression for requests and responses is introduced with https://github.com/agemooij/riak-scala-client/pull/40 PR.
When trying to delete an already deleted object, Riak returns a 404 response with a
text/plain
body - "not found". However, this response MIGHT have a "Content-Encoding: gzip" header (and non-compressed body still). Trying to decompress the payload of such response leads to an internaljava.util.zip.ZipException: Not in GZIP format
exception in the riak client's http pipeline.How to reproduce
It has proved to be almost impossible to easily reproduce that behaviour with
curl
. But a test scenario inRiakGzipSpec.scala
submitted together with the #40 pull request triggers this behaviour in ~75% runs on my machine.Workaround
As a workaround, we may want to not fail response decompression directive in case of a
ZipException
, but just proceed with payload as it is. ( yes, it does sound ugly :) )