You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@storm.apache.org by Luke Rohde <ro...@gmail.com> on 2015/03/19 16:01:17 UTC

kryo buffer underflow exception

Hi, I'm seeing this exception from kryo deep inside storm and I haven't
been able to figure it out. Forums/docs on kryo seem to mention that this
can happen if you use a kryo instance in multiple threads concurrently, but
I'm not doing that (and this appears to be coming from storm). Has anyone
seen/dealt with this before? The stack trace:

java.lang.RuntimeException: com.esotericsoftware.kryo.KryoException: Buffer
underflow.
        at
backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:128)
~[storm-core-0.9.3.jar:0.9.3]
        at
backtype.storm.utils.DisruptorQueue.consumeBatchWhenAvailable(DisruptorQueue.java:99)
~[storm-core-0.9.3.jar:0.9.3]
        at
backtype.storm.disruptor$consume_batch_when_available.invoke(disruptor.clj:80)
~[storm-core-0.9.3.jar:0.9.3]
        at
backtype.storm.daemon.executor$fn__3441$fn__3453$fn__3500.invoke(executor.clj:748)
~[storm-core-0.9.3.jar:0.9.3]
        at backtype.storm.util$async_loop$fn__464.invoke(util.clj:463)
~[storm-core-0.9.3.jar:0.9.3]
        at clojure.lang.AFn.run(AFn.java:24) [clojure-1.5.1.jar:na]
        at java.lang.Thread.run(Thread.java:745) [na:1.8.0_40]
Caused by: com.esotericsoftware.kryo.KryoException: Buffer underflow.
        at com.esotericsoftware.kryo.io.Input.require(Input.java:156)
~[kryo-2.21.jar:na]
        at com.esotericsoftware.kryo.io.Input.readInt(Input.java:337)
~[kryo-2.21.jar:na]
        at
com.esotericsoftware.kryo.util.DefaultClassResolver.readClass(DefaultClassResolver.java:109)
~[kryo-2.21.jar:na]
        at com.esotericsoftware.kryo.Kryo.readClass(Kryo.java:610)
~[kryo-2.21.jar:na]
        at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:721)
~[kryo-2.21.jar:na]
        at
com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:109)
~[kryo-2.21.jar:na]
        at
com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:18)
~[kryo-2.21.jar:na]
        at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:629)
~[kryo-2.21.jar:na]
        at
backtype.storm.serialization.KryoValuesDeserializer.deserializeFrom(KryoValuesDeserializer.java:38)
~[storm-core-0.9.3.jar:0.9.3]
        at
backtype.storm.serialization.KryoTupleDeserializer.deserialize(KryoTupleDeserializer.java:53)
~[storm-core-0.9.3.jar:0.9.3]
        at
backtype.storm.daemon.executor$mk_task_receiver$fn__3364.invoke(executor.clj:398)
~[storm-core-0.9.3.jar:0.9.3]
        at
backtype.storm.disruptor$clojure_handler$reify__1447.onEvent(disruptor.clj:58)
~[storm-core-0.9.3.jar:0.9.3]
        at
backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:125)
~[storm-core-0.9.3.jar:0.9.3]
        ... 6 common frames omitted

Re: kryo buffer underflow exception

Posted by Banias H <ba...@gmail.com>.
I have the exact same error. The difference though is that it only showed
up when I scaled up my topology.

DETAIL
------------
We have a 3-bolt topology and we use a simple Java POJO that implements
KryoSerializable to send data between bolts. The topology was runnnig fine
until when we scaled it up to a certain point, and the Kryo underflow error
would start throwing in the second bolt.

The implementation:
Bolt2.java

public void execute(Tuple tuple, BasicOutputCollector collector) {
if (tuple.size() > 0) {
try {
SimplePojo sources = new SimplePojo((SimplePojo) tuple.getValue(0));
...

SimplePojo.java:

public class SimplePojo implements KryoSerializable {
 private long id1;
private long id2;
private byte[] bin1;
private byte[] bin2;

public SimplePojo(SimplePojo from) {
id1 = from.getId1();
id2 = from.getId2();
bin1 = from.getBin1();
bin2 = from.getBin2();
}

//getters
public long getId1() {
return id1;
}

public long getId2() {
return id2;
}

public byte[] getBin1() {
return bin1;
}

public byte[] getBin2() {
return bin2;
}

...

@Override
public void read(Kryo kryo, Input input) {
id1 = input.readLong();
id2 = input.readLong();

int bin1Len = input.readInt();
bin1 = input.readBytes(bin1Len); //Line 156

int bin2Len = input.readInt();
bin2 = input.readBytes(bin2Len);
}

@Override
public void write(Kryo kryo, Output output) {
output.writeLong(id1);
output.writeLong(id2);

output.writeInt(bin1.length);
output.write(bin1);

output.writeInt(bin2.length);
output.write(bin2);
}
}

What I think the problem is:
In the stack trace, the error was thrown in line 156 in SimplePojo.java
above when it was trying to read bytes. So I would think the
buffer-underflow occurred in the executor's incoming queue and I think the
data that goes into the queue is slower than it can be consumed. But I am
not sure. If that is the case, what are some of the configurations I can
look at? Any advice or suggestion would be appreciated.

Thanks,
B

On Fri, Mar 20, 2015 at 1:53 AM, Vladimir Protsenko <pr...@gmail.com>
wrote:

> In my case I had a custom KryoSerializer and write method was pushing
> length of array and *wrong* number of bytes. When serializer read method
>  input.readBytes(length)  tried to read expected number of bytes it throws
> such exception.
>
>
>
>
>
> 2015-03-20 2:01 GMT+04:00 Luke Rohde <ro...@gmail.com>:
>
>> Yeah, apologies. The section of my topology in question is like this:
>>
>> Spout -> Bolt1 -> Bolt2
>>
>> Bolt1 declares an outputstream with fields (A, B) of respective types
>> (String, [Custom type])
>> This works fine.
>>
>> But if Bolt1 tacks on a third field (in this case a String), I get this
>> buffer underflow exception in Bolt3 when storm deserializes.
>> I also just discovered that this does not happen if I put the additional
>> string field in the middle and not at the end.
>>
>> Does that help? My sense is that this is probably a kryo bug.
>>
>> Appreciate you taking the time.
>>
>>
>>
>> On Thu, Mar 19, 2015 at 5:07 PM P. Taylor Goetz <pt...@gmail.com>
>> wrote:
>>
>>> Hi Luke,
>>>
>>> Can you elaborate on the steps necessary to reproduce the problem?
>>> There’s not much to go on here.
>>>
>>> -Taylor
>>>
>>> On Mar 19, 2015, at 4:40 PM, Luke Rohde <ro...@gmail.com> wrote:
>>>
>>> How did you resolve it? This started being a problem after I added a
>>> third field to an output tuple, just a String.
>>>
>>> On Thu, Mar 19, 2015 at 4:20 PM Vladimir Protsenko <
>>> protsenkovi@gmail.com> wrote:
>>>
>>>> Hi, I've got once the same error when in deserialization was reading
>>>> the wrong number of bytes that were sent in serialization code.
>>>>
>>>> 2015-03-19 19:01 GMT+04:00 Luke Rohde <ro...@gmail.com>:
>>>>
>>>>> Hi, I'm seeing this exception from kryo deep inside storm and I
>>>>> haven't been able to figure it out. Forums/docs on kryo seem to mention
>>>>> that this can happen if you use a kryo instance in multiple threads
>>>>> concurrently, but I'm not doing that (and this appears to be coming from
>>>>> storm). Has anyone seen/dealt with this before? The stack trace:
>>>>>
>>>>> java.lang.RuntimeException: com.esotericsoftware.kryo.KryoException:
>>>>> Buffer underflow.
>>>>>         at
>>>>> backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:128)
>>>>> ~[storm-core-0.9.3.jar:0.9.3]
>>>>>         at
>>>>> backtype.storm.utils.DisruptorQueue.consumeBatchWhenAvailable(DisruptorQueue.java:99)
>>>>> ~[storm-core-0.9.3.jar:0.9.3]
>>>>>         at
>>>>> backtype.storm.disruptor$consume_batch_when_available.invoke(disruptor.clj:80)
>>>>> ~[storm-core-0.9.3.jar:0.9.3]
>>>>>         at
>>>>> backtype.storm.daemon.executor$fn__3441$fn__3453$fn__3500.invoke(executor.clj:748)
>>>>> ~[storm-core-0.9.3.jar:0.9.3]
>>>>>         at backtype.storm.util$async_loop$fn__464.invoke(util.clj:463)
>>>>> ~[storm-core-0.9.3.jar:0.9.3]
>>>>>         at clojure.lang.AFn.run(AFn.java:24) [clojure-1.5.1.jar:na]
>>>>>         at java.lang.Thread.run(Thread.java:745) [na:1.8.0_40]
>>>>> Caused by: com.esotericsoftware.kryo.KryoException: Buffer underflow.
>>>>>         at com.esotericsoftware.kryo.io.Input.require(Input.java:156)
>>>>> ~[kryo-2.21.jar:na]
>>>>>         at com.esotericsoftware.kryo.io.Input.readInt(Input.java:337)
>>>>> ~[kryo-2.21.jar:na]
>>>>>         at
>>>>> com.esotericsoftware.kryo.util.DefaultClassResolver.readClass(DefaultClassResolver.java:109)
>>>>> ~[kryo-2.21.jar:na]
>>>>>         at com.esotericsoftware.kryo.Kryo.readClass(Kryo.java:610)
>>>>> ~[kryo-2.21.jar:na]
>>>>>         at
>>>>> com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:721)
>>>>> ~[kryo-2.21.jar:na]
>>>>>         at
>>>>> com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:109)
>>>>> ~[kryo-2.21.jar:na]
>>>>>         at
>>>>> com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:18)
>>>>> ~[kryo-2.21.jar:na]
>>>>>         at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:629)
>>>>> ~[kryo-2.21.jar:na]
>>>>>         at
>>>>> backtype.storm.serialization.KryoValuesDeserializer.deserializeFrom(KryoValuesDeserializer.java:38)
>>>>> ~[storm-core-0.9.3.jar:0.9.3]
>>>>>         at
>>>>> backtype.storm.serialization.KryoTupleDeserializer.deserialize(KryoTupleDeserializer.java:53)
>>>>> ~[storm-core-0.9.3.jar:0.9.3]
>>>>>         at
>>>>> backtype.storm.daemon.executor$mk_task_receiver$fn__3364.invoke(executor.clj:398)
>>>>> ~[storm-core-0.9.3.jar:0.9.3]
>>>>>         at
>>>>> backtype.storm.disruptor$clojure_handler$reify__1447.onEvent(disruptor.clj:58)
>>>>> ~[storm-core-0.9.3.jar:0.9.3]
>>>>>         at
>>>>> backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:125)
>>>>> ~[storm-core-0.9.3.jar:0.9.3]
>>>>>         ... 6 common frames omitted
>>>>>
>>>>>
>>>>
>>>
>

Re: kryo buffer underflow exception

Posted by Vladimir Protsenko <pr...@gmail.com>.
In my case I had a custom KryoSerializer and write method was pushing
length of array and *wrong* number of bytes. When serializer read method
 input.readBytes(length)  tried to read expected number of bytes it throws
such exception.





2015-03-20 2:01 GMT+04:00 Luke Rohde <ro...@gmail.com>:

> Yeah, apologies. The section of my topology in question is like this:
>
> Spout -> Bolt1 -> Bolt2
>
> Bolt1 declares an outputstream with fields (A, B) of respective types
> (String, [Custom type])
> This works fine.
>
> But if Bolt1 tacks on a third field (in this case a String), I get this
> buffer underflow exception in Bolt3 when storm deserializes.
> I also just discovered that this does not happen if I put the additional
> string field in the middle and not at the end.
>
> Does that help? My sense is that this is probably a kryo bug.
>
> Appreciate you taking the time.
>
>
>
> On Thu, Mar 19, 2015 at 5:07 PM P. Taylor Goetz <pt...@gmail.com> wrote:
>
>> Hi Luke,
>>
>> Can you elaborate on the steps necessary to reproduce the problem?
>> There’s not much to go on here.
>>
>> -Taylor
>>
>> On Mar 19, 2015, at 4:40 PM, Luke Rohde <ro...@gmail.com> wrote:
>>
>> How did you resolve it? This started being a problem after I added a
>> third field to an output tuple, just a String.
>>
>> On Thu, Mar 19, 2015 at 4:20 PM Vladimir Protsenko <pr...@gmail.com>
>> wrote:
>>
>>> Hi, I've got once the same error when in deserialization was reading the
>>> wrong number of bytes that were sent in serialization code.
>>>
>>> 2015-03-19 19:01 GMT+04:00 Luke Rohde <ro...@gmail.com>:
>>>
>>>> Hi, I'm seeing this exception from kryo deep inside storm and I haven't
>>>> been able to figure it out. Forums/docs on kryo seem to mention that this
>>>> can happen if you use a kryo instance in multiple threads concurrently, but
>>>> I'm not doing that (and this appears to be coming from storm). Has anyone
>>>> seen/dealt with this before? The stack trace:
>>>>
>>>> java.lang.RuntimeException: com.esotericsoftware.kryo.KryoException:
>>>> Buffer underflow.
>>>>         at
>>>> backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:128)
>>>> ~[storm-core-0.9.3.jar:0.9.3]
>>>>         at
>>>> backtype.storm.utils.DisruptorQueue.consumeBatchWhenAvailable(DisruptorQueue.java:99)
>>>> ~[storm-core-0.9.3.jar:0.9.3]
>>>>         at
>>>> backtype.storm.disruptor$consume_batch_when_available.invoke(disruptor.clj:80)
>>>> ~[storm-core-0.9.3.jar:0.9.3]
>>>>         at
>>>> backtype.storm.daemon.executor$fn__3441$fn__3453$fn__3500.invoke(executor.clj:748)
>>>> ~[storm-core-0.9.3.jar:0.9.3]
>>>>         at backtype.storm.util$async_loop$fn__464.invoke(util.clj:463)
>>>> ~[storm-core-0.9.3.jar:0.9.3]
>>>>         at clojure.lang.AFn.run(AFn.java:24) [clojure-1.5.1.jar:na]
>>>>         at java.lang.Thread.run(Thread.java:745) [na:1.8.0_40]
>>>> Caused by: com.esotericsoftware.kryo.KryoException: Buffer underflow.
>>>>         at com.esotericsoftware.kryo.io.Input.require(Input.java:156)
>>>> ~[kryo-2.21.jar:na]
>>>>         at com.esotericsoftware.kryo.io.Input.readInt(Input.java:337)
>>>> ~[kryo-2.21.jar:na]
>>>>         at
>>>> com.esotericsoftware.kryo.util.DefaultClassResolver.readClass(DefaultClassResolver.java:109)
>>>> ~[kryo-2.21.jar:na]
>>>>         at com.esotericsoftware.kryo.Kryo.readClass(Kryo.java:610)
>>>> ~[kryo-2.21.jar:na]
>>>>         at
>>>> com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:721)
>>>> ~[kryo-2.21.jar:na]
>>>>         at
>>>> com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:109)
>>>> ~[kryo-2.21.jar:na]
>>>>         at
>>>> com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:18)
>>>> ~[kryo-2.21.jar:na]
>>>>         at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:629)
>>>> ~[kryo-2.21.jar:na]
>>>>         at
>>>> backtype.storm.serialization.KryoValuesDeserializer.deserializeFrom(KryoValuesDeserializer.java:38)
>>>> ~[storm-core-0.9.3.jar:0.9.3]
>>>>         at
>>>> backtype.storm.serialization.KryoTupleDeserializer.deserialize(KryoTupleDeserializer.java:53)
>>>> ~[storm-core-0.9.3.jar:0.9.3]
>>>>         at
>>>> backtype.storm.daemon.executor$mk_task_receiver$fn__3364.invoke(executor.clj:398)
>>>> ~[storm-core-0.9.3.jar:0.9.3]
>>>>         at
>>>> backtype.storm.disruptor$clojure_handler$reify__1447.onEvent(disruptor.clj:58)
>>>> ~[storm-core-0.9.3.jar:0.9.3]
>>>>         at
>>>> backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:125)
>>>> ~[storm-core-0.9.3.jar:0.9.3]
>>>>         ... 6 common frames omitted
>>>>
>>>>
>>>
>>

Re: kryo buffer underflow exception

Posted by Luke Rohde <ro...@gmail.com>.
Yeah, apologies. The section of my topology in question is like this:

Spout -> Bolt1 -> Bolt2

Bolt1 declares an outputstream with fields (A, B) of respective types
(String, [Custom type])
This works fine.

But if Bolt1 tacks on a third field (in this case a String), I get this
buffer underflow exception in Bolt3 when storm deserializes.
I also just discovered that this does not happen if I put the additional
string field in the middle and not at the end.

Does that help? My sense is that this is probably a kryo bug.

Appreciate you taking the time.



On Thu, Mar 19, 2015 at 5:07 PM P. Taylor Goetz <pt...@gmail.com> wrote:

> Hi Luke,
>
> Can you elaborate on the steps necessary to reproduce the problem? There’s
> not much to go on here.
>
> -Taylor
>
> On Mar 19, 2015, at 4:40 PM, Luke Rohde <ro...@gmail.com> wrote:
>
> How did you resolve it? This started being a problem after I added a third
> field to an output tuple, just a String.
>
> On Thu, Mar 19, 2015 at 4:20 PM Vladimir Protsenko <pr...@gmail.com>
> wrote:
>
>> Hi, I've got once the same error when in deserialization was reading the
>> wrong number of bytes that were sent in serialization code.
>>
>> 2015-03-19 19:01 GMT+04:00 Luke Rohde <ro...@gmail.com>:
>>
>>> Hi, I'm seeing this exception from kryo deep inside storm and I haven't
>>> been able to figure it out. Forums/docs on kryo seem to mention that this
>>> can happen if you use a kryo instance in multiple threads concurrently, but
>>> I'm not doing that (and this appears to be coming from storm). Has anyone
>>> seen/dealt with this before? The stack trace:
>>>
>>> java.lang.RuntimeException: com.esotericsoftware.kryo.KryoException:
>>> Buffer underflow.
>>>         at
>>> backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:128)
>>> ~[storm-core-0.9.3.jar:0.9.3]
>>>         at
>>> backtype.storm.utils.DisruptorQueue.consumeBatchWhenAvailable(DisruptorQueue.java:99)
>>> ~[storm-core-0.9.3.jar:0.9.3]
>>>         at
>>> backtype.storm.disruptor$consume_batch_when_available.invoke(disruptor.clj:80)
>>> ~[storm-core-0.9.3.jar:0.9.3]
>>>         at
>>> backtype.storm.daemon.executor$fn__3441$fn__3453$fn__3500.invoke(executor.clj:748)
>>> ~[storm-core-0.9.3.jar:0.9.3]
>>>         at backtype.storm.util$async_loop$fn__464.invoke(util.clj:463)
>>> ~[storm-core-0.9.3.jar:0.9.3]
>>>         at clojure.lang.AFn.run(AFn.java:24) [clojure-1.5.1.jar:na]
>>>         at java.lang.Thread.run(Thread.java:745) [na:1.8.0_40]
>>> Caused by: com.esotericsoftware.kryo.KryoException: Buffer underflow.
>>>         at com.esotericsoftware.kryo.io.Input.require(Input.java:156)
>>> ~[kryo-2.21.jar:na]
>>>         at com.esotericsoftware.kryo.io.Input.readInt(Input.java:337)
>>> ~[kryo-2.21.jar:na]
>>>         at
>>> com.esotericsoftware.kryo.util.DefaultClassResolver.readClass(DefaultClassResolver.java:109)
>>> ~[kryo-2.21.jar:na]
>>>         at com.esotericsoftware.kryo.Kryo.readClass(Kryo.java:610)
>>> ~[kryo-2.21.jar:na]
>>>         at
>>> com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:721)
>>> ~[kryo-2.21.jar:na]
>>>         at
>>> com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:109)
>>> ~[kryo-2.21.jar:na]
>>>         at
>>> com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:18)
>>> ~[kryo-2.21.jar:na]
>>>         at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:629)
>>> ~[kryo-2.21.jar:na]
>>>         at
>>> backtype.storm.serialization.KryoValuesDeserializer.deserializeFrom(KryoValuesDeserializer.java:38)
>>> ~[storm-core-0.9.3.jar:0.9.3]
>>>         at
>>> backtype.storm.serialization.KryoTupleDeserializer.deserialize(KryoTupleDeserializer.java:53)
>>> ~[storm-core-0.9.3.jar:0.9.3]
>>>         at
>>> backtype.storm.daemon.executor$mk_task_receiver$fn__3364.invoke(executor.clj:398)
>>> ~[storm-core-0.9.3.jar:0.9.3]
>>>         at
>>> backtype.storm.disruptor$clojure_handler$reify__1447.onEvent(disruptor.clj:58)
>>> ~[storm-core-0.9.3.jar:0.9.3]
>>>         at
>>> backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:125)
>>> ~[storm-core-0.9.3.jar:0.9.3]
>>>         ... 6 common frames omitted
>>>
>>>
>>
>

Re: kryo buffer underflow exception

Posted by "P. Taylor Goetz" <pt...@gmail.com>.
Hi Luke,

Can you elaborate on the steps necessary to reproduce the problem? There’s not much to go on here.

-Taylor

On Mar 19, 2015, at 4:40 PM, Luke Rohde <ro...@gmail.com> wrote:

> How did you resolve it? This started being a problem after I added a third field to an output tuple, just a String. 
> 
> On Thu, Mar 19, 2015 at 4:20 PM Vladimir Protsenko <pr...@gmail.com> wrote:
> Hi, I've got once the same error when in deserialization was reading the wrong number of bytes that were sent in serialization code.
> 
> 2015-03-19 19:01 GMT+04:00 Luke Rohde <ro...@gmail.com>:
> Hi, I'm seeing this exception from kryo deep inside storm and I haven't been able to figure it out. Forums/docs on kryo seem to mention that this can happen if you use a kryo instance in multiple threads concurrently, but I'm not doing that (and this appears to be coming from storm). Has anyone seen/dealt with this before? The stack trace:
> 
> java.lang.RuntimeException: com.esotericsoftware.kryo.KryoException: Buffer underflow.
>         at backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:128) ~[storm-core-0.9.3.jar:0.9.3]
>         at backtype.storm.utils.DisruptorQueue.consumeBatchWhenAvailable(DisruptorQueue.java:99) ~[storm-core-0.9.3.jar:0.9.3]
>         at backtype.storm.disruptor$consume_batch_when_available.invoke(disruptor.clj:80) ~[storm-core-0.9.3.jar:0.9.3]
>         at backtype.storm.daemon.executor$fn__3441$fn__3453$fn__3500.invoke(executor.clj:748) ~[storm-core-0.9.3.jar:0.9.3]
>         at backtype.storm.util$async_loop$fn__464.invoke(util.clj:463) ~[storm-core-0.9.3.jar:0.9.3]
>         at clojure.lang.AFn.run(AFn.java:24) [clojure-1.5.1.jar:na]
>         at java.lang.Thread.run(Thread.java:745) [na:1.8.0_40]
> Caused by: com.esotericsoftware.kryo.KryoException: Buffer underflow.
>         at com.esotericsoftware.kryo.io.Input.require(Input.java:156) ~[kryo-2.21.jar:na]
>         at com.esotericsoftware.kryo.io.Input.readInt(Input.java:337) ~[kryo-2.21.jar:na]
>         at com.esotericsoftware.kryo.util.DefaultClassResolver.readClass(DefaultClassResolver.java:109) ~[kryo-2.21.jar:na]
>         at com.esotericsoftware.kryo.Kryo.readClass(Kryo.java:610) ~[kryo-2.21.jar:na]
>         at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:721) ~[kryo-2.21.jar:na]
>         at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:109) ~[kryo-2.21.jar:na]
>         at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:18) ~[kryo-2.21.jar:na]
>         at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:629) ~[kryo-2.21.jar:na]
>         at backtype.storm.serialization.KryoValuesDeserializer.deserializeFrom(KryoValuesDeserializer.java:38) ~[storm-core-0.9.3.jar:0.9.3]
>         at backtype.storm.serialization.KryoTupleDeserializer.deserialize(KryoTupleDeserializer.java:53) ~[storm-core-0.9.3.jar:0.9.3]
>         at backtype.storm.daemon.executor$mk_task_receiver$fn__3364.invoke(executor.clj:398) ~[storm-core-0.9.3.jar:0.9.3]
>         at backtype.storm.disruptor$clojure_handler$reify__1447.onEvent(disruptor.clj:58) ~[storm-core-0.9.3.jar:0.9.3]
>         at backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:125) ~[storm-core-0.9.3.jar:0.9.3]
>         ... 6 common frames omitted
> 
> 


Re: kryo buffer underflow exception

Posted by Luke Rohde <ro...@gmail.com>.
How did you resolve it? This started being a problem after I added a third
field to an output tuple, just a String.

On Thu, Mar 19, 2015 at 4:20 PM Vladimir Protsenko <pr...@gmail.com>
wrote:

> Hi, I've got once the same error when in deserialization was reading the
> wrong number of bytes that were sent in serialization code.
>
> 2015-03-19 19:01 GMT+04:00 Luke Rohde <ro...@gmail.com>:
>
>> Hi, I'm seeing this exception from kryo deep inside storm and I haven't
>> been able to figure it out. Forums/docs on kryo seem to mention that this
>> can happen if you use a kryo instance in multiple threads concurrently, but
>> I'm not doing that (and this appears to be coming from storm). Has anyone
>> seen/dealt with this before? The stack trace:
>>
>> java.lang.RuntimeException: com.esotericsoftware.kryo.KryoException:
>> Buffer underflow.
>>         at
>> backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:128)
>> ~[storm-core-0.9.3.jar:0.9.3]
>>         at
>> backtype.storm.utils.DisruptorQueue.consumeBatchWhenAvailable(DisruptorQueue.java:99)
>> ~[storm-core-0.9.3.jar:0.9.3]
>>         at
>> backtype.storm.disruptor$consume_batch_when_available.invoke(disruptor.clj:80)
>> ~[storm-core-0.9.3.jar:0.9.3]
>>         at
>> backtype.storm.daemon.executor$fn__3441$fn__3453$fn__3500.invoke(executor.clj:748)
>> ~[storm-core-0.9.3.jar:0.9.3]
>>         at backtype.storm.util$async_loop$fn__464.invoke(util.clj:463)
>> ~[storm-core-0.9.3.jar:0.9.3]
>>         at clojure.lang.AFn.run(AFn.java:24) [clojure-1.5.1.jar:na]
>>         at java.lang.Thread.run(Thread.java:745) [na:1.8.0_40]
>> Caused by: com.esotericsoftware.kryo.KryoException: Buffer underflow.
>>         at com.esotericsoftware.kryo.io.Input.require(Input.java:156)
>> ~[kryo-2.21.jar:na]
>>         at com.esotericsoftware.kryo.io.Input.readInt(Input.java:337)
>> ~[kryo-2.21.jar:na]
>>         at
>> com.esotericsoftware.kryo.util.DefaultClassResolver.readClass(DefaultClassResolver.java:109)
>> ~[kryo-2.21.jar:na]
>>         at com.esotericsoftware.kryo.Kryo.readClass(Kryo.java:610)
>> ~[kryo-2.21.jar:na]
>>         at
>> com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:721)
>> ~[kryo-2.21.jar:na]
>>         at
>> com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:109)
>> ~[kryo-2.21.jar:na]
>>         at
>> com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:18)
>> ~[kryo-2.21.jar:na]
>>         at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:629)
>> ~[kryo-2.21.jar:na]
>>         at
>> backtype.storm.serialization.KryoValuesDeserializer.deserializeFrom(KryoValuesDeserializer.java:38)
>> ~[storm-core-0.9.3.jar:0.9.3]
>>         at
>> backtype.storm.serialization.KryoTupleDeserializer.deserialize(KryoTupleDeserializer.java:53)
>> ~[storm-core-0.9.3.jar:0.9.3]
>>         at
>> backtype.storm.daemon.executor$mk_task_receiver$fn__3364.invoke(executor.clj:398)
>> ~[storm-core-0.9.3.jar:0.9.3]
>>         at
>> backtype.storm.disruptor$clojure_handler$reify__1447.onEvent(disruptor.clj:58)
>> ~[storm-core-0.9.3.jar:0.9.3]
>>         at
>> backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:125)
>> ~[storm-core-0.9.3.jar:0.9.3]
>>         ... 6 common frames omitted
>>
>>
>

Re: kryo buffer underflow exception

Posted by Vladimir Protsenko <pr...@gmail.com>.
Hi, I've got once the same error when in deserialization was reading the
wrong number of bytes that were sent in serialization code.

2015-03-19 19:01 GMT+04:00 Luke Rohde <ro...@gmail.com>:

> Hi, I'm seeing this exception from kryo deep inside storm and I haven't
> been able to figure it out. Forums/docs on kryo seem to mention that this
> can happen if you use a kryo instance in multiple threads concurrently, but
> I'm not doing that (and this appears to be coming from storm). Has anyone
> seen/dealt with this before? The stack trace:
>
> java.lang.RuntimeException: com.esotericsoftware.kryo.KryoException:
> Buffer underflow.
>         at
> backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:128)
> ~[storm-core-0.9.3.jar:0.9.3]
>         at
> backtype.storm.utils.DisruptorQueue.consumeBatchWhenAvailable(DisruptorQueue.java:99)
> ~[storm-core-0.9.3.jar:0.9.3]
>         at
> backtype.storm.disruptor$consume_batch_when_available.invoke(disruptor.clj:80)
> ~[storm-core-0.9.3.jar:0.9.3]
>         at
> backtype.storm.daemon.executor$fn__3441$fn__3453$fn__3500.invoke(executor.clj:748)
> ~[storm-core-0.9.3.jar:0.9.3]
>         at backtype.storm.util$async_loop$fn__464.invoke(util.clj:463)
> ~[storm-core-0.9.3.jar:0.9.3]
>         at clojure.lang.AFn.run(AFn.java:24) [clojure-1.5.1.jar:na]
>         at java.lang.Thread.run(Thread.java:745) [na:1.8.0_40]
> Caused by: com.esotericsoftware.kryo.KryoException: Buffer underflow.
>         at com.esotericsoftware.kryo.io.Input.require(Input.java:156)
> ~[kryo-2.21.jar:na]
>         at com.esotericsoftware.kryo.io.Input.readInt(Input.java:337)
> ~[kryo-2.21.jar:na]
>         at
> com.esotericsoftware.kryo.util.DefaultClassResolver.readClass(DefaultClassResolver.java:109)
> ~[kryo-2.21.jar:na]
>         at com.esotericsoftware.kryo.Kryo.readClass(Kryo.java:610)
> ~[kryo-2.21.jar:na]
>         at
> com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:721)
> ~[kryo-2.21.jar:na]
>         at
> com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:109)
> ~[kryo-2.21.jar:na]
>         at
> com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:18)
> ~[kryo-2.21.jar:na]
>         at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:629)
> ~[kryo-2.21.jar:na]
>         at
> backtype.storm.serialization.KryoValuesDeserializer.deserializeFrom(KryoValuesDeserializer.java:38)
> ~[storm-core-0.9.3.jar:0.9.3]
>         at
> backtype.storm.serialization.KryoTupleDeserializer.deserialize(KryoTupleDeserializer.java:53)
> ~[storm-core-0.9.3.jar:0.9.3]
>         at
> backtype.storm.daemon.executor$mk_task_receiver$fn__3364.invoke(executor.clj:398)
> ~[storm-core-0.9.3.jar:0.9.3]
>         at
> backtype.storm.disruptor$clojure_handler$reify__1447.onEvent(disruptor.clj:58)
> ~[storm-core-0.9.3.jar:0.9.3]
>         at
> backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:125)
> ~[storm-core-0.9.3.jar:0.9.3]
>         ... 6 common frames omitted
>
>