Hi,

On Tue, Jul 1, 2014 at 5:02 PM, Jukka Zitting <[email protected]> wrote:
> On Tue, Jul 1, 2014 at 9:57 AM,  <[email protected]> wrote:
>> -            return rep.getBlobStore().readBlob(blobId, pos, buff, off, 
>> length);
>> +            int read = rep.getBlobStore().readBlob(blobId, pos, buff, off, 
>> length);
>> +            return read < 0 ? 0 : read;
>
> Shouldn't this (and all the other similar lines) be:
>
>     return read < 0 ? -1 : read;
>
> ? My build gets stuck in an infinite loop because the read() method returns 0.

Answering my own questions: it shouldn't, as described in the issue.

The stuck thread I saw was (same stack trace for many minutes):

"main" #1 prio=5 os_prio=0 tid=0x00000000024c8000 nid=0x4c90 runnable
[0x00000000030fd000]
   java.lang.Thread.State: RUNNABLE
        at org.apache.jackrabbit.oak.commons.IOUtils.skipFully(IOUtils.java:80)
        at 
org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore.readBlob(AbstractBlobStore.java:431)
        at 
org.apache.jackrabbit.oak.plugins.document.DocumentMK.read(DocumentMK.java:322)
        at 
org.apache.jackrabbit.oak.commons.mk.MicroKernelInputStream.read(MicroKernelInputStream.java:56)
        at com.google.common.io.ByteStreams.read(ByteStreams.java:828)
        at com.google.common.io.ByteSource.contentEquals(ByteSource.java:304)
        at com.google.common.io.ByteStreams.equal(ByteStreams.java:661)
        at 
org.apache.jackrabbit.oak.plugins.memory.AbstractBlob.equal(AbstractBlob.java:58)
        at 
org.apache.jackrabbit.oak.plugins.memory.AbstractBlob.equals(AbstractBlob.java:153)
        at org.junit.Assert.isEquals(Assert.java:132)
        at org.junit.Assert.assertEquals(Assert.java:121)
        at org.junit.Assert.assertEquals(Assert.java:147)
        at 
org.apache.jackrabbit.oak.core.MutableTreeTest.testBlob(MutableTreeTest.java:474)

A subsequent build didn't reproduce this problem, so it might have
been some unrelated transient problem. I'll let you know if this
occurs again.

BR,

Jukka Zitting

Reply via email to