<br><br><div class="gmail_quote">On Mon, Apr 19, 2010 at 12:36 PM, <span dir="ltr"><<a href="mailto:galder@jboss.org">galder@jboss.org</a>></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't solve your problem, correct? Did you test this out by any chance?<br>
</blockquote><div><br></div><div>Yep, "<span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">Basically InputStream#available() is utterly broken.".</span></div>
<div><span class="Apple-style-span" style="font-family: Arial, sans-serif; font-size: 12px; border-collapse: collapse; ">GzipIbputStream'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>
----- "philippe van dyck" <<a href="mailto:pvdyck@gmail.com">pvdyck@gmail.com</a>> wrote:<br>
<br>
> Hi all,<br>
><br>
> the problem is in the JDK and linked to a 10 years old -never fixed-<br>
> bug in GZipInputStream...<br>
> I propose to get rid of GZipInputStream and use Apache Commons<br>
> Bzip2Compressor streams in the CloudCacheStore.<br>
><br>
> (And BTW, using len=inputStream.available() is a very bad idea with<br>
> GZipInputStream...)<br>
><br>
> WDYT ?<br>
><br>
> phil<br>
><br>
> Début du message réexpédié :<br>
><br>
> > De : Philippe Van Dyck <<a href="mailto:pvdyck@gmail.com">pvdyck@gmail.com</a>><br>
> > Date : 16 avril 2010 10:45:19 HAEC<br>
> > À : infinispan -Dev List <<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a>><br>
> > Objet : Bug : read after end of stream @ AbstractMarshaller<br>
> ><br>
> > Hi all,<br>
> ><br>
> > since I use an InflaterInputStream to send objects to S3 using<br>
> JClouds Blobstore, I need a very strict management of streams.<br>
> > In AbstractMarshaller, while ((bytesRead = inputStream.read(buf, 0,<br>
> buf.length)) != -1) bytes.write(buf, 0, bytesRead) will read after the<br>
> stream's end, waiting for '-1' to happen.<br>
> > You cannot do that with a GZIPInputStream because you will get a<br>
> "java.io.EOFException: Unexpected end of ZLIB input stream".<br>
> > Should I file a bug or correct the code ?<br>
> ><br>
> > phil<br>
> Début du message réexpédié :<br>
><br>
> > De : Philippe Van Dyck <<a href="mailto:pvdyck@gmail.com">pvdyck@gmail.com</a>><br>
> > Date : 16 avril 2010 10:52:22 HAEC<br>
> > À : infinispan -Dev List <<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a>><br>
> > Objet : Réexp : Bug : read after end of stream @ AbstractMarshaller<br>
> ><br>
> > Ok, I took a closer look.<br>
> > Actually, it is related to HTTPCORE-199, and this bug is fixed.<br>
> > What about using int len = inputStream.available(); in<br>
> AbstractMarshaller again ?<br>
> ><br>
> > phil<br>
> ><br>
> > ---------- Forwarded message ----------<br>
> > From: Philippe Van Dyck <<a href="mailto:pvdyck@gmail.com">pvdyck@gmail.com</a>><br>
> > Date: Fri, Apr 16, 2010 at 10:45 AM<br>
> > Subject: Bug : read after end of stream @ AbstractMarshaller<br>
> > To: infinispan -Dev List <<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a>><br>
> ><br>
> ><br>
> > Hi all,<br>
> ><br>
> > since I use an InflaterInputStream to send objects to S3 using<br>
> JClouds Blobstore, I need a very strict management of streams.<br>
> > In AbstractMarshaller, while ((bytesRead = inputStream.read(buf, 0,<br>
> buf.length)) != -1) bytes.write(buf, 0, bytesRead) will read after the<br>
> stream's end, waiting for '-1' to happen.<br>
> > You cannot do that with a GZIPInputStream because you will get a<br>
> "java.io.EOFException: Unexpected end of ZLIB input stream".<br>
> > Should I file a bug or correct the code ?<br>
> ><br>
> > phil<br>
> ><br>
> Début du message réexpédié :<br>
><br>
> > De : Philippe Van Dyck <<a href="mailto:pvdyck@gmail.com">pvdyck@gmail.com</a>><br>
> > Date : 16 avril 2010 11:50:54 HAEC<br>
> > À : infinispan -Dev List <<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a>><br>
> > Objet : Réexp : Bug : read after end of stream @ AbstractMarshaller<br>
> ><br>
> > Ok, JDK Bug<br>
> <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>
> ><br>
> > The workaround is to simply ignore (!) the EOFException...<br>
> ><br>
> > WDYT ?<br>
> ><br>
> > phil<br>
> ><br>
> > ---------- Forwarded message ----------<br>
> > From: Philippe Van Dyck <<a href="mailto:pvdyck@gmail.com">pvdyck@gmail.com</a>><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 <<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a>><br>
> ><br>
> ><br>
> > Ok, I took a closer look.<br>
> > Actually, it is related to HTTPCORE-199, and this bug is fixed.<br>
> > What about using int len = inputStream.available(); in<br>
> AbstractMarshaller again ?<br>
> ><br>
> > phil<br>
> ><br>
> ><br>
> > ---------- Forwarded message ----------<br>
> > From: Philippe Van Dyck <<a href="mailto:pvdyck@gmail.com">pvdyck@gmail.com</a>><br>
> > Date: Fri, Apr 16, 2010 at 10:45 AM<br>
> > Subject: Bug : read after end of stream @ AbstractMarshaller<br>
> > To: infinispan -Dev List <<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a>><br>
> ><br>
> ><br>
> > Hi all,<br>
> ><br>
> > since I use an InflaterInputStream to send objects to S3 using<br>
> JClouds Blobstore, I need a very strict management of streams.<br>
> > In AbstractMarshaller, while ((bytesRead = inputStream.read(buf, 0,<br>
> buf.length)) != -1) bytes.write(buf, 0, bytesRead) will read after the<br>
> stream's end, waiting for '-1' to happen.<br>
> > You cannot do that with a GZIPInputStream because you will get a<br>
> "java.io.EOFException: Unexpected end of ZLIB input stream".<br>
> > Should I file a bug or correct the code ?<br>
> ><br>
> > phil<br>
> ><br>
> ><br>
><br>
><br>
</div></div>> _______________________________________________<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><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>