<br><br><div class="gmail_quote">On Mon, Apr 19, 2010 at 3:14 PM,  <span dir="ltr">&lt;<a href="mailto:galder@jboss.org">galder@jboss.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Phillipe,<br>
<br>
See below:<br>
<div class="im"><br>
----- &quot;Philippe Van Dyck&quot; &lt;<a href="mailto:pvdyck@gmail.com">pvdyck@gmail.com</a>&gt; wrote:<br>
<br>
&gt; On Mon, Apr 19, 2010 at 12:36 PM, &lt;<a href="mailto:galder@jboss.org">galder@jboss.org</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt; Hi Philippe,<br>
&gt; &gt;<br>
&gt; &gt; So, to sum up, trying to fix<br>
</div>&gt; <a href="https://jira.jboss.org/jira/browse/ISPN-133won&#39;t" target="_blank">https://jira.jboss.org/jira/browse/ISPN-133won&#39;t</a> solve your problem,<br>
<div class="im">&gt; correct? Did you test this out by any chance?<br>
&gt; &gt;<br>
&gt;<br>
&gt; Yep, &quot;Basically InputStream#available() is utterly broken.&quot;.<br>
&gt; GzipIbputStream&#39;s implementation is :<br>
&gt;  public int available() throws IOException {<br>
&gt;         ensureOpen();<br>
&gt;         if (reachEOF) {<br>
&gt;             return 0;<br>
&gt;         } else {<br>
&gt;             return 1;<br>
&gt;         }<br>
&gt;     }<br>
&gt;<br>
&gt; You definitely cannot use the return value to set your buffer size.<br>
<br>
</div>Interesting. It seems like it&#39;s not only Apache&#39;s HTTP client library that did not care much about available() implementations, but also JDK classes as well. I&#39;d rather read on 1k batches than 1 byte batches. See things like this, I&#39;m even less inclined to urgently look into <a href="https://jira.jboss.org/jira/browse/ISPN-133" target="_blank">https://jira.jboss.org/jira/browse/ISPN-133</a>.<br>
</blockquote><div><br></div><div><br></div><div>I even think you could close it !</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
&gt;<br>
&gt;<br>
&gt; &gt; Did you test Bzip2Compressor streams to see if that worked?<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; Yes, perfectly, one more dependency to add to commons compression...<br>
&gt; any<br>
&gt; problem with that ?<br>
<br>
</div>I suppose that&#39;s a dependency to the cloud cache store module, correct? If so, I&#39;m fine with it :)<br>
<div class="im"><br>
&gt;<br>
&gt; The updated CloudCacheStore with bzip2 compression is ready...<br>
<br>
</div>Cool, thanks very much for working on this!!<br></blockquote><div><br></div><div>Am I suppose to file a bug ? To what Jira issue do you want me to link the svn commit ?</div><div> </div><div><br></div><div>Phil</div>
<div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5"><br>
&gt;<br>
&gt; Cheers,<br>
&gt;<br>
&gt; Phil<br>
&gt;<br>
&gt;<br>
&gt; &gt; Cheers,<br>
&gt; &gt;<br>
&gt; &gt; ----- &quot;philippe van dyck&quot; &lt;<a href="mailto:pvdyck@gmail.com">pvdyck@gmail.com</a>&gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt; &gt; Hi all,<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; the problem is in the JDK and linked to a 10 years old -never<br>
&gt; fixed-<br>
&gt; &gt; &gt; bug in GZipInputStream...<br>
&gt; &gt; &gt; I propose to get rid of GZipInputStream and use Apache Commons<br>
&gt; &gt; &gt; Bzip2Compressor streams in the CloudCacheStore.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; (And BTW, using len=inputStream.available() is a very bad idea<br>
&gt; with<br>
&gt; &gt; &gt; GZipInputStream...)<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; WDYT ?<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; phil<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Début du message réexpédié :<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; De : Philippe Van Dyck &lt;<a href="mailto:pvdyck@gmail.com">pvdyck@gmail.com</a>&gt;<br>
&gt; &gt; &gt; &gt; Date : 16 avril 2010 10:45:19 HAEC<br>
&gt; &gt; &gt; &gt; À : infinispan -Dev List &lt;<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a>&gt;<br>
&gt; &gt; &gt; &gt; Objet : Bug : read after end of stream @ AbstractMarshaller<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Hi all,<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; since I use an InflaterInputStream to send objects to S3 using<br>
&gt; &gt; &gt; JClouds Blobstore, I need a very strict management of streams.<br>
&gt; &gt; &gt; &gt; In AbstractMarshaller,  while ((bytesRead =<br>
&gt; inputStream.read(buf, 0,<br>
&gt; &gt; &gt; buf.length)) != -1) bytes.write(buf, 0, bytesRead) will read after<br>
&gt; the<br>
&gt; &gt; &gt; stream&#39;s end, waiting for &#39;-1&#39; to happen.<br>
&gt; &gt; &gt; &gt; You cannot do that with a GZIPInputStream because you will get<br>
&gt; a<br>
&gt; &gt; &gt; &quot;java.io.EOFException: Unexpected end of ZLIB input stream&quot;.<br>
&gt; &gt; &gt; &gt; Should I file a bug or correct the code ?<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; phil<br>
&gt; &gt; &gt; Début du message réexpédié :<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; De : Philippe Van Dyck &lt;<a href="mailto:pvdyck@gmail.com">pvdyck@gmail.com</a>&gt;<br>
&gt; &gt; &gt; &gt; Date : 16 avril 2010 10:52:22 HAEC<br>
&gt; &gt; &gt; &gt; À : infinispan -Dev List &lt;<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a>&gt;<br>
&gt; &gt; &gt; &gt; Objet : Réexp : Bug : read after end of stream @<br>
&gt; AbstractMarshaller<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Ok, I took a closer look.<br>
&gt; &gt; &gt; &gt; Actually, it is related to HTTPCORE-199, and this bug is fixed.<br>
&gt; &gt; &gt; &gt; What about using int len = inputStream.available(); in<br>
&gt; &gt; &gt; AbstractMarshaller again ?<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; phil<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; ---------- Forwarded message ----------<br>
&gt; &gt; &gt; &gt; From: Philippe Van Dyck &lt;<a href="mailto:pvdyck@gmail.com">pvdyck@gmail.com</a>&gt;<br>
&gt; &gt; &gt; &gt; Date: Fri, Apr 16, 2010 at 10:45 AM<br>
&gt; &gt; &gt; &gt; Subject: Bug : read after end of stream @ AbstractMarshaller<br>
&gt; &gt; &gt; &gt; To: infinispan -Dev List &lt;<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a>&gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Hi all,<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; since I use an InflaterInputStream to send objects to S3 using<br>
&gt; &gt; &gt; JClouds Blobstore, I need a very strict management of streams.<br>
&gt; &gt; &gt; &gt; In AbstractMarshaller,  while ((bytesRead =<br>
&gt; inputStream.read(buf, 0,<br>
&gt; &gt; &gt; buf.length)) != -1) bytes.write(buf, 0, bytesRead) will read after<br>
&gt; the<br>
&gt; &gt; &gt; stream&#39;s end, waiting for &#39;-1&#39; to happen.<br>
&gt; &gt; &gt; &gt; You cannot do that with a GZIPInputStream because you will get<br>
&gt; a<br>
&gt; &gt; &gt; &quot;java.io.EOFException: Unexpected end of ZLIB input stream&quot;.<br>
&gt; &gt; &gt; &gt; Should I file a bug or correct the code ?<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; phil<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; Début du message réexpédié :<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; De : Philippe Van Dyck &lt;<a href="mailto:pvdyck@gmail.com">pvdyck@gmail.com</a>&gt;<br>
&gt; &gt; &gt; &gt; Date : 16 avril 2010 11:50:54 HAEC<br>
&gt; &gt; &gt; &gt; À : infinispan -Dev List &lt;<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a>&gt;<br>
&gt; &gt; &gt; &gt; Objet : Réexp : Bug : read after end of stream @<br>
&gt; AbstractMarshaller<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Ok, JDK Bug<br>
&gt; &gt; &gt; <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6519463" target="_blank">http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6519463</a><br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; The workaround is to simply ignore (!) the EOFException...<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; WDYT ?<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; phil<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; ---------- Forwarded message ----------<br>
&gt; &gt; &gt; &gt; From: Philippe Van Dyck &lt;<a href="mailto:pvdyck@gmail.com">pvdyck@gmail.com</a>&gt;<br>
&gt; &gt; &gt; &gt; Date: Fri, Apr 16, 2010 at 10:52 AM<br>
&gt; &gt; &gt; &gt; Subject: Fwd: Bug : read after end of stream @<br>
&gt; AbstractMarshaller<br>
&gt; &gt; &gt; &gt; To: infinispan -Dev List &lt;<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a>&gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Ok, I took a closer look.<br>
&gt; &gt; &gt; &gt; Actually, it is related to HTTPCORE-199, and this bug is fixed.<br>
&gt; &gt; &gt; &gt; What about using int len = inputStream.available(); in<br>
&gt; &gt; &gt; AbstractMarshaller again ?<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; phil<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; ---------- Forwarded message ----------<br>
&gt; &gt; &gt; &gt; From: Philippe Van Dyck &lt;<a href="mailto:pvdyck@gmail.com">pvdyck@gmail.com</a>&gt;<br>
&gt; &gt; &gt; &gt; Date: Fri, Apr 16, 2010 at 10:45 AM<br>
&gt; &gt; &gt; &gt; Subject: Bug : read after end of stream @ AbstractMarshaller<br>
&gt; &gt; &gt; &gt; To: infinispan -Dev List &lt;<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a>&gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Hi all,<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; since I use an InflaterInputStream to send objects to S3 using<br>
&gt; &gt; &gt; JClouds Blobstore, I need a very strict management of streams.<br>
&gt; &gt; &gt; &gt; In AbstractMarshaller,  while ((bytesRead =<br>
&gt; inputStream.read(buf, 0,<br>
&gt; &gt; &gt; buf.length)) != -1) bytes.write(buf, 0, bytesRead) will read after<br>
&gt; the<br>
&gt; &gt; &gt; stream&#39;s end, waiting for &#39;-1&#39; to happen.<br>
&gt; &gt; &gt; &gt; You cannot do that with a GZIPInputStream because you will get<br>
&gt; a<br>
&gt; &gt; &gt; &quot;java.io.EOFException: Unexpected end of ZLIB input stream&quot;.<br>
&gt; &gt; &gt; &gt; Should I file a bug or correct the code ?<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; phil<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; _______________________________________________<br>
&gt; &gt; &gt; infinispan-dev mailing list<br>
&gt; &gt; &gt; <a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
&gt; &gt; &gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
&gt; &gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; infinispan-dev mailing list<br>
&gt; &gt; <a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
&gt; &gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; infinispan-dev mailing list<br>
&gt; <a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
<br>
_______________________________________________<br>
infinispan-dev mailing list<br>
<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a></div></div></blockquote></div><br>