<br><br><div class="gmail_quote">On Mon, Apr 19, 2010 at 12:36 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 Philippe,<br>
<br>
So, to sum up, trying to fix <a href="https://jira.jboss.org/jira/browse/ISPN-133" target="_blank">https://jira.jboss.org/jira/browse/ISPN-133</a> won&#39;t solve your problem, correct? Did you test this out by any chance?<br>
</blockquote><div><br></div><div>Yep, &quot;<span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">Basically InputStream#available() is utterly broken.&quot;.</span></div>
<div><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">GzipIbputStream&#39;s implementation is :</span></div><div><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; "><div>
 public int available() throws IOException {</div><div>        ensureOpen();</div><div>        if (reachEOF) {</div><div>            return 0;</div><div>        } else {</div><div>            return 1;</div><div>        }</div>
<div>    }</div><div><br></div><div>You definitely cannot use the return value to set your buffer size.</div></span></div><div><font class="Apple-style-span" face="Arial, sans-serif" size="3"><span class="Apple-style-span" style="border-collapse: collapse; font-size: 12px;"><br>
</span></font></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Did you test Bzip2Compressor streams to see if that worked?<br>
<br></blockquote><div><br></div><div>Yes, perfectly, one more dependency to add to commons compression... any problem with that ?</div><div><br></div><div>The updated CloudCacheStore with bzip2 compression is ready...</div>
<div><br></div><div>Cheers,</div><div><br></div><div>Phil</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Cheers,<br>
<div><div></div><div class="h5"><br>
----- &quot;philippe van dyck&quot; &lt;<a href="mailto:pvdyck@gmail.com">pvdyck@gmail.com</a>&gt; wrote:<br>
<br>
&gt; Hi all,<br>
&gt;<br>
&gt; the problem is in the JDK and linked to a 10 years old -never fixed-<br>
&gt; bug in GZipInputStream...<br>
&gt; I propose to get rid of GZipInputStream and use Apache Commons<br>
&gt; Bzip2Compressor streams in the CloudCacheStore.<br>
&gt;<br>
&gt; (And BTW, using len=inputStream.available() is a very bad idea with<br>
&gt; GZipInputStream...)<br>
&gt;<br>
&gt; WDYT ?<br>
&gt;<br>
&gt; phil<br>
&gt;<br>
&gt; Début du message réexpédié :<br>
&gt;<br>
&gt; &gt; De : Philippe Van Dyck &lt;<a href="mailto:pvdyck@gmail.com">pvdyck@gmail.com</a>&gt;<br>
&gt; &gt; Date : 16 avril 2010 10:45:19 HAEC<br>
&gt; &gt; À : infinispan -Dev List &lt;<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a>&gt;<br>
&gt; &gt; Objet : Bug : read after end of stream @ AbstractMarshaller<br>
&gt; &gt;<br>
&gt; &gt; Hi all,<br>
&gt; &gt;<br>
&gt; &gt; since I use an InflaterInputStream to send objects to S3 using<br>
&gt; JClouds Blobstore, I need a very strict management of streams.<br>
&gt; &gt; In AbstractMarshaller,  while ((bytesRead = inputStream.read(buf, 0,<br>
&gt; buf.length)) != -1) bytes.write(buf, 0, bytesRead) will read after the<br>
&gt; stream&#39;s end, waiting for &#39;-1&#39; to happen.<br>
&gt; &gt; You cannot do that with a GZIPInputStream because you will get a<br>
&gt; &quot;java.io.EOFException: Unexpected end of ZLIB input stream&quot;.<br>
&gt; &gt; Should I file a bug or correct the code ?<br>
&gt; &gt;<br>
&gt; &gt; phil<br>
&gt; Début du message réexpédié :<br>
&gt;<br>
&gt; &gt; De : Philippe Van Dyck &lt;<a href="mailto:pvdyck@gmail.com">pvdyck@gmail.com</a>&gt;<br>
&gt; &gt; Date : 16 avril 2010 10:52:22 HAEC<br>
&gt; &gt; À : infinispan -Dev List &lt;<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a>&gt;<br>
&gt; &gt; Objet : Réexp : Bug : read after end of stream @ AbstractMarshaller<br>
&gt; &gt;<br>
&gt; &gt; Ok, I took a closer look.<br>
&gt; &gt; Actually, it is related to HTTPCORE-199, and this bug is fixed.<br>
&gt; &gt; What about using int len = inputStream.available(); in<br>
&gt; AbstractMarshaller again ?<br>
&gt; &gt;<br>
&gt; &gt; phil<br>
&gt; &gt;<br>
&gt; &gt; ---------- Forwarded message ----------<br>
&gt; &gt; From: Philippe Van Dyck &lt;<a href="mailto:pvdyck@gmail.com">pvdyck@gmail.com</a>&gt;<br>
&gt; &gt; Date: Fri, Apr 16, 2010 at 10:45 AM<br>
&gt; &gt; Subject: Bug : read after end of stream @ AbstractMarshaller<br>
&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;<br>
&gt; &gt;<br>
&gt; &gt; Hi all,<br>
&gt; &gt;<br>
&gt; &gt; since I use an InflaterInputStream to send objects to S3 using<br>
&gt; JClouds Blobstore, I need a very strict management of streams.<br>
&gt; &gt; In AbstractMarshaller,  while ((bytesRead = inputStream.read(buf, 0,<br>
&gt; buf.length)) != -1) bytes.write(buf, 0, bytesRead) will read after the<br>
&gt; stream&#39;s end, waiting for &#39;-1&#39; to happen.<br>
&gt; &gt; You cannot do that with a GZIPInputStream because you will get a<br>
&gt; &quot;java.io.EOFException: Unexpected end of ZLIB input stream&quot;.<br>
&gt; &gt; Should I file a bug or correct the code ?<br>
&gt; &gt;<br>
&gt; &gt; phil<br>
&gt; &gt;<br>
&gt; Début du message réexpédié :<br>
&gt;<br>
&gt; &gt; De : Philippe Van Dyck &lt;<a href="mailto:pvdyck@gmail.com">pvdyck@gmail.com</a>&gt;<br>
&gt; &gt; Date : 16 avril 2010 11:50:54 HAEC<br>
&gt; &gt; À : infinispan -Dev List &lt;<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a>&gt;<br>
&gt; &gt; Objet : Réexp : Bug : read after end of stream @ AbstractMarshaller<br>
&gt; &gt;<br>
&gt; &gt; Ok, JDK Bug<br>
&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;<br>
&gt; &gt; The workaround is to simply ignore (!) the EOFException...<br>
&gt; &gt;<br>
&gt; &gt; WDYT ?<br>
&gt; &gt;<br>
&gt; &gt; phil<br>
&gt; &gt;<br>
&gt; &gt; ---------- Forwarded message ----------<br>
&gt; &gt; From: Philippe Van Dyck &lt;<a href="mailto:pvdyck@gmail.com">pvdyck@gmail.com</a>&gt;<br>
&gt; &gt; Date: Fri, Apr 16, 2010 at 10:52 AM<br>
&gt; &gt; Subject: Fwd: Bug : read after end of stream @ AbstractMarshaller<br>
&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;<br>
&gt; &gt;<br>
&gt; &gt; Ok, I took a closer look.<br>
&gt; &gt; Actually, it is related to HTTPCORE-199, and this bug is fixed.<br>
&gt; &gt; What about using int len = inputStream.available(); in<br>
&gt; AbstractMarshaller again ?<br>
&gt; &gt;<br>
&gt; &gt; phil<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; ---------- Forwarded message ----------<br>
&gt; &gt; From: Philippe Van Dyck &lt;<a href="mailto:pvdyck@gmail.com">pvdyck@gmail.com</a>&gt;<br>
&gt; &gt; Date: Fri, Apr 16, 2010 at 10:45 AM<br>
&gt; &gt; Subject: Bug : read after end of stream @ AbstractMarshaller<br>
&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;<br>
&gt; &gt;<br>
&gt; &gt; Hi all,<br>
&gt; &gt;<br>
&gt; &gt; since I use an InflaterInputStream to send objects to S3 using<br>
&gt; JClouds Blobstore, I need a very strict management of streams.<br>
&gt; &gt; In AbstractMarshaller,  while ((bytesRead = inputStream.read(buf, 0,<br>
&gt; buf.length)) != -1) bytes.write(buf, 0, bytesRead) will read after the<br>
&gt; stream&#39;s end, waiting for &#39;-1&#39; to happen.<br>
&gt; &gt; You cannot do that with a GZIPInputStream because you will get a<br>
&gt; &quot;java.io.EOFException: Unexpected end of ZLIB input stream&quot;.<br>
&gt; &gt; Should I file a bug or correct the code ?<br>
&gt; &gt;<br>
&gt; &gt; phil<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; infinispan-dev mailing list<br>
<div class="im">&gt; <a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
</div>&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>
<div class="im"><a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
</div><a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a></blockquote></div><br>