]> git.saurik.com Git - redis.git/commitdiff
MIGRATE now let the client distinguish I/O errors and timeouts from other erros.
authorantirez <antirez@gmail.com>
Mon, 2 Apr 2012 14:38:24 +0000 (16:38 +0200)
committerantirez <antirez@gmail.com>
Mon, 2 Apr 2012 14:41:02 +0000 (16:41 +0200)
src/migrate.c

index ae312c4156bec67280d9ff90a211b7a330fc5f6c..9087531216469ee9bf0d81a11da209c9297d1b1a 100644 (file)
@@ -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;