Fix index error of CRLF when replying with integer-encoded strings#13711
Fix index error of CRLF when replying with integer-encoded strings#13711ShooterIT merged 3 commits intoredis:unstablefrom raffertyyu:unstable
Conversation
|
If correct, this is a severe bug; it'll insta-break many clients (or at least any that enforce inbound protocol correctness) |
Yeah, that's the second question I'm thinking about. This bug is introduced in last month(a106198), but the existings tcl test scripts couldn't find it. redis-cli could parse the returned content correctly. Why? |
|
A client could silently just skip the trailing 2 bytes without enforcing them. I know for sure that my client will not like this malformed data. |
|
@raffertyyu thanks, please also make a test(using |
|
thank you @raffertyyu merged |
|
i have a branch in which robj is a little bigger, and in that case, this value (
|
@oranagra Perhaps when readraw is enabled, we could return a full protocol response when executing a command, instead of only returning a single line. like: |
|
for that the reader needs to understand what it reads and know how much to read. |
This PR mainly fixes two flakiness tests. 1. Fix the failure of `Active Defrag HFE with ebrax` test in `memefficiency.tcl` When `redisObject` structure size changes, the current test design becomes flakiness: In the current test, we will create 1 hash key + N string keys. When we delete this string key, these hash keys may be evenly distributed in robj 's slabs, resulting in the inability to perform defragmentation. 2. Fix `bulk reply protocol` test in `protocol.tcl` introduced by #13711 When `OBJ_ENCODING_EMBSTR_SIZE_LIMIT` (currently 44) changes, it can cause this test to fail. This isn't necessarily a problem, but the main issue is that we use `rawread` to verify encoding correctness. If the reply length doesn't match exactly, it can cause the test to hang and become difficult to debug.
…edis#13711) close redis#13709 Fix the index error of CRLF character for integer-encoded strings in addReplyBulk function --------- Co-authored-by: debing.sun <debing.sun@redis.com>
close #13709
fix the index error of CRLF character in addReplyBulk function.