seanjensengrey / jmemcache-daemon

Automatically exported from code.google.com/p/jmemcache-daemon
Apache License 2.0
0 stars 0 forks source link

IndexOutOfBoundsException under load #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. start jmemcached (cli or core)
2. send lots of set, gets and add operations to it via tcp until cpu load is 
saturized.

What is the expected output? What do you see instead?
I expect that jmemcached processes all operations sent just like under low 
load. But what I see instead are some IndexOutOfBoundsExceptions thrown 
regularly (at about ~1% of the memcached operations).

What version of the product are you using? On what operating system?
0.9.3-SNAPSHOT

Please provide any additional information below.

The exception is thrown in netty's skipBytes(int length) method. This is 
invoked in MemcachedFrameDecoder.decode() like follows:

buffer.skipBytes(minFrameLength + minDelimLength);

Unfortunately readableBytes() is not checked in advance. It looks like the 
issue occurs in case the arrival of the CR+LF sequence is handled by two 
separate invocations of MemcachedFrameDecoder.decode(ChannelHandlerContext ctx, 
org.jboss.netty.channel.Channel channel, ChannelBuffer buffer).

I have attached a patch to illustrate the issue, please review whether this is 
the best way to fix it.

Original issue reported on code.google.com by henning@ganix.de on 16 Nov 2010 at 3:37

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Was solved by fix proposed in issue ID=16

Original comment by henning@ganix.de on 16 Nov 2010 at 6:07

GoogleCodeExporter commented 9 years ago

Original comment by ryan.daum on 10 Jan 2011 at 6:16