<br><br><div class="gmail_quote">On Mon, Apr 19, 2010 at 3:14 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 Phillipe,<br>
<br>
See below:<br>
<div class="im"><br>
----- "Philippe Van Dyck" <<a href="mailto:pvdyck@gmail.com">pvdyck@gmail.com</a>> wrote:<br>
<br>
> On Mon, Apr 19, 2010 at 12:36 PM, <<a href="mailto:galder@jboss.org">galder@jboss.org</a>> wrote:<br>
><br>
> > Hi Philippe,<br>
> ><br>
> > So, to sum up, trying to fix<br>
</div>> <a href="https://jira.jboss.org/jira/browse/ISPN-133won't" target="_blank">https://jira.jboss.org/jira/browse/ISPN-133won't</a> solve your problem,<br>
<div class="im">> correct? Did you test this out by any chance?<br>
> ><br>
><br>
> Yep, "Basically InputStream#available() is utterly broken.".<br>
> GzipIbputStream's implementation is :<br>
> public int available() throws IOException {<br>
> ensureOpen();<br>
> if (reachEOF) {<br>
> return 0;<br>
> } else {<br>
> return 1;<br>
> }<br>
> }<br>
><br>
> You definitely cannot use the return value to set your buffer size.<br>
<br>
</div>Interesting. It seems like it's not only Apache's HTTP client library that did not care much about available() implementations, but also JDK classes as well. I'd rather read on 1k batches than 1 byte batches. See things like this, I'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>
><br>
><br>
> > Did you test Bzip2Compressor streams to see if that worked?<br>
> ><br>
> ><br>
> Yes, perfectly, one more dependency to add to commons compression...<br>
> any<br>
> problem with that ?<br>
<br>
</div>I suppose that's a dependency to the cloud cache store module, correct? If so, I'm fine with it :)<br>
<div class="im"><br>
><br>
> 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>
><br>
> Cheers,<br>
><br>
> Phil<br>
><br>
><br>
> > Cheers,<br>
> ><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<br>
> 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<br>
> 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 =<br>
> inputStream.read(buf, 0,<br>
> > > buf.length)) != -1) bytes.write(buf, 0, bytesRead) will read after<br>
> the<br>
> > > stream's end, waiting for '-1' to happen.<br>
> > > > You cannot do that with a GZIPInputStream because you will get<br>
> 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 @<br>
> 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 =<br>
> inputStream.read(buf, 0,<br>
> > > buf.length)) != -1) bytes.write(buf, 0, bytesRead) will read after<br>
> the<br>
> > > stream's end, waiting for '-1' to happen.<br>
> > > > You cannot do that with a GZIPInputStream because you will get<br>
> 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 @<br>
> 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 @<br>
> 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 =<br>
> inputStream.read(buf, 0,<br>
> > > buf.length)) != -1) bytes.write(buf, 0, bytesRead) will read after<br>
> the<br>
> > > stream's end, waiting for '-1' to happen.<br>
> > > > You cannot do that with a GZIPInputStream because you will get<br>
> 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>
> > > _______________________________________________<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><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><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><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>