When server closes the connection, either by shutting down or some protocol irregularity, the libuv adapter crashes in redisLibuvPoll() when calling redisAsyncHandleWrite(). Reason for the crash is that the prior call to redisAsyncHandleRead() frees the context.
I have solved it by placing redisAsyncHandleWrite() before redisAsyncHandleRead(), however, considering that this happens because redisBufferRead(c) == REDIS_ERR causes the __redisAsyncDisconnect(ac) call, the better solution would be to make redisAsyncHandleRead() and redisAsyncHandleWrite() return status.
When server closes the connection, either by shutting down or some protocol irregularity, the libuv adapter crashes in
redisLibuvPoll()when callingredisAsyncHandleWrite(). Reason for the crash is that the prior call toredisAsyncHandleRead()frees the context.I have solved it by placing
redisAsyncHandleWrite()beforeredisAsyncHandleRead(), however, considering that this happens becauseredisBufferRead(c) == REDIS_ERRcauses the__redisAsyncDisconnect(ac)call, the better solution would be to makeredisAsyncHandleRead()andredisAsyncHandleWrite()return status.