fix bug in Protocol.processBulkReply()

* if RedisInputStream().read() at Protocol.processBulkReply() returns
-1, it runs with unexpected behavior
* fix: check and if return value is -1, it throws
JedisConnectionException with message "server has closed the connection"
** prevent unexpected behavior, specially ArrayIndexOutOfBoundException 
*** calls System.arraycopy() with length = -1 (cause limit = -1) at
RedisInputStream.read()

add pubsub unit test scenario : client-output-buffer-limit exceed

* Redis warns event(disconnect client) to their log, and suddenly
disconnected connection
** http://redis.io/topics/clients -> Output buffers limits
** so test expects JedisConnectionException with proper message
This commit is contained in:
임정택
2013-10-16 18:22:04 +09:00
parent 597366343d
commit e9506298f8
3 changed files with 76 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ pidfile /tmp/redis1.pid
logfile /tmp/redis1.log
save ""
appendonly no
client-output-buffer-limit pubsub 256k 128k 5
endef
define REDIS2_CONF