Closed slmgong closed 6 years ago
Do you have some sort of message logging to see what came out of the redis? I have been using Redis for quite a while, haven't seen this so far.
@StormHub last time i say it on gitter . change the code same to java will ok .
if (readableBytes == 0 || this.remainingBulkLength == 0 && readableBytes < RedisConstants.EndOfLineLength)
the test case will cause the error.
` DotNetty.Transport.Channels.Embedded.EmbeddedChannel embeddedChannel = new DotNetty.Transport.Channels.Embedded.EmbeddedChannel( new DotNetty.Codecs.Redis.RedisDecoder(), new DotNetty.Codecs.Redis.RedisBulkStringAggregator(), new DotNetty.Codecs.Redis.RedisArrayAggregator());
string test = "*3\r\n$7\r\nmessage\r\n$16\r\nTd:demo_response\r\n$3\r\nabc\r";
embeddedChannel.WriteInbound(test.Buffer());
var r = embeddedChannel.ReadInbound<DotNetty.Codecs.Redis.Messages.ArrayRedisMessage>();
embeddedChannel.WriteInbound("\n".Buffer());
var r2 = embeddedChannel.ReadInbound<DotNetty.Codecs.Redis.Messages.ArrayRedisMessage>();`
@vivid216 Cool, let me have a look at it first.
sometimes my app got an out of memory exception when test redis program. when i debug the function DecodeBulkStringContent here
` bool DecodeBulkStringContent(IByteBuffer byteBuffer, ICollection
Variable remainingBulkLength=0, but the readableBytes=1, and got a dead loop until out of memory, and now test byteBuffer.readByte() = 13, i don't know what happened, redis server send an wrong message or other ?