From 37cc07dd418718a06f7309891b1e5c7c272a4b48 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 2 Apr 2012 16:38:24 +0200 Subject: [PATCH] MIGRATE now let the client distinguish I/O errors and timeouts from other erros. --- src/migrate.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/migrate.c b/src/migrate.c index ae312c41..90875312 100644 --- a/src/migrate.c +++ b/src/migrate.c @@ -158,7 +158,7 @@ void migrateCommand(redisClient *c) { return; } if ((aeWait(fd,AE_WRITABLE,timeout*1000) & AE_WRITABLE) == 0) { - addReplyError(c,"Timeout connecting to the client"); + addReplySds(c,sdsnew("-IOERR error or timeout connecting to the client\r\n")); return; } @@ -229,19 +229,13 @@ void migrateCommand(redisClient *c) { return; socket_wr_err: - redisLog(REDIS_NOTICE,"Can't write to target node for MIGRATE: %s", - strerror(errno)); - addReplyErrorFormat(c,"MIGRATE failed, writing to target node: %s.", - strerror(errno)); + addReplySds(c,sdsnew("-IOERR error or timeout writing to target instance\r\n")); sdsfree(cmd.io.buffer.ptr); close(fd); return; socket_rd_err: - redisLog(REDIS_NOTICE,"Can't read from target node for MIGRATE: %s", - strerror(errno)); - addReplyErrorFormat(c,"MIGRATE failed, reading from target node: %s.", - strerror(errno)); + addReplySds(c,sdsnew("-IOERR error or timeout reading from target node\r\n")); sdsfree(cmd.io.buffer.ptr); close(fd); return; -- 2.45.2