<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi all,<div><br></div><div>the problem is in the JDK and linked to a 10 years old -never fixed- bug in GZipInputStream...</div><div>I propose to get rid of GZipInputStream and use Apache Commons Bzip2Compressor streams in the CloudCacheStore.</div><div><br></div><div>(And BTW, using len=inputStream.available() is a very bad idea with GZipInputStream...)</div><div><br></div><div>WDYT ?</div><div><br></div><div>phil</div><div><div><br><div>Début du message réexpédié :</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 1);"><b>De : </b></span><span style="font-family:'Helvetica'; font-size:medium;">Philippe Van Dyck &lt;<a href="mailto:pvdyck@gmail.com">pvdyck@gmail.com</a>&gt;<br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 1);"><b>Date : </b></span><span style="font-family:'Helvetica'; font-size:medium;">16 avril 2010 10:45:19 HAEC<br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 1);"><b>À : </b></span><span style="font-family:'Helvetica'; font-size:medium;">infinispan -Dev List &lt;<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a>&gt;<br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 1);"><b>Objet : </b></span><span style="font-family:'Helvetica'; font-size:medium;"><b>Bug : read after end of stream @ AbstractMarshaller</b><br></span></div><br>Hi all,<div><br></div><div>since I use an InflaterInputStream to send objects to S3 using JClouds Blobstore, I need a very strict management of streams.</div><div>In AbstractMarshaller,&nbsp;&nbsp;while ((bytesRead = inputStream.read(buf, 0, buf.length)) != -1) bytes.write(buf, 0, bytesRead) will read after the stream's end, waiting for '-1' to happen.</div>
<div>You cannot do that with a&nbsp;GZIPInputStream because you will get a "java.io.EOFException: Unexpected end of ZLIB input stream".</div><div>Should I file a bug or correct the code ?</div><div><br></div><div>phil</div>
</blockquote><div>Début du message réexpédié :</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 1);"><b>De : </b></span><span style="font-family:'Helvetica'; font-size:medium;">Philippe Van Dyck &lt;<a href="mailto:pvdyck@gmail.com">pvdyck@gmail.com</a>&gt;<br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 1);"><b>Date : </b></span><span style="font-family:'Helvetica'; font-size:medium;">16 avril 2010 10:52:22 HAEC<br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 1);"><b>À : </b></span><span style="font-family:'Helvetica'; font-size:medium;">infinispan -Dev List &lt;<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a>&gt;<br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 1);"><b>Objet : </b></span><span style="font-family:'Helvetica'; font-size:medium;"><b>Réexp : Bug : read after end of stream @ AbstractMarshaller</b><br></span></div><br>Ok, I took a closer look.<div>Actually, it is related to HTTPCORE-199, and this bug is fixed.</div><div>What about using&nbsp;int len = inputStream.available(); in AbstractMarshaller again ?</div><div><br></div><div>phil<br><br>
<div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Philippe Van Dyck</b> <span dir="ltr">&lt;<a href="mailto:pvdyck@gmail.com">pvdyck@gmail.com</a>&gt;</span><br>Date: Fri, Apr 16, 2010 at 10:45 AM<br>
Subject: Bug : read after end of stream @ AbstractMarshaller<br>To: infinispan -Dev List &lt;<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a>&gt;<br><br><br>Hi all,<div><br></div><div>since I use an InflaterInputStream to send objects to S3 using JClouds Blobstore, I need a very strict management of streams.</div>
<div>In AbstractMarshaller,&nbsp;&nbsp;while ((bytesRead = inputStream.read(buf, 0, buf.length)) != -1) bytes.write(buf, 0, bytesRead) will read after the stream's end, waiting for '-1' to happen.</div>
<div>You cannot do that with a&nbsp;GZIPInputStream because you will get a "java.io.EOFException: Unexpected end of ZLIB input stream".</div><div>Should I file a bug or correct the code ?</div><div><br></div><div>phil</div>

</div><br></div>
</blockquote><div>Début du message réexpédié :</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 1);"><b>De : </b></span><span style="font-family:'Helvetica'; font-size:medium;">Philippe Van Dyck &lt;<a href="mailto:pvdyck@gmail.com">pvdyck@gmail.com</a>&gt;<br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 1);"><b>Date : </b></span><span style="font-family:'Helvetica'; font-size:medium;">16 avril 2010 11:50:54 HAEC<br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 1);"><b>À : </b></span><span style="font-family:'Helvetica'; font-size:medium;">infinispan -Dev List &lt;<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a>&gt;<br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; font-size:medium; color:rgba(0, 0, 0, 1);"><b>Objet : </b></span><span style="font-family:'Helvetica'; font-size:medium;"><b>Réexp : Bug : read after end of stream @ AbstractMarshaller</b><br></span></div><br>Ok, JDK Bug &nbsp;<a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6519463">http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6519463</a><div><br></div><div>The workaround is to simply ignore (!) the&nbsp;EOFException...</div>
<div><br></div><div>WDYT ?</div><div><br></div><div>phil<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Philippe Van Dyck</b> <span dir="ltr">&lt;<a href="mailto:pvdyck@gmail.com">pvdyck@gmail.com</a>&gt;</span><br>
Date: Fri, Apr 16, 2010 at 10:52 AM<br>Subject: Fwd: Bug : read after end of stream @ AbstractMarshaller<br>To: infinispan -Dev List &lt;<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a>&gt;<br>
<br><br>Ok, I took a closer look.<div>Actually, it is related to HTTPCORE-199, and this bug is fixed.</div><div>What about using&nbsp;int len = inputStream.available(); in AbstractMarshaller again ?</div><div><br></div><div>phil<div>
<div></div><div class="h5"><br><br>
<div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Philippe Van Dyck</b> <span dir="ltr">&lt;<a href="mailto:pvdyck@gmail.com" target="_blank">pvdyck@gmail.com</a>&gt;</span><br>
Date: Fri, Apr 16, 2010 at 10:45 AM<br>
Subject: Bug : read after end of stream @ AbstractMarshaller<br>To: infinispan -Dev List &lt;<a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a>&gt;<br><br><br>Hi all,<div><br>
</div><div>since I use an InflaterInputStream to send objects to S3 using JClouds Blobstore, I need a very strict management of streams.</div>
<div>In AbstractMarshaller,&nbsp;&nbsp;while ((bytesRead = inputStream.read(buf, 0, buf.length)) != -1) bytes.write(buf, 0, bytesRead) will read after the stream's end, waiting for '-1' to happen.</div>
<div>You cannot do that with a&nbsp;GZIPInputStream because you will get a "java.io.EOFException: Unexpected end of ZLIB input stream".</div><div>Should I file a bug or correct the code ?</div><div><br></div><div>phil</div>


</div><br></div></div></div>
</div><br></div>
</blockquote></div><br></div></body></html>