Skip to content

Commit

Permalink
MIGRATE now let the client distinguish I/O errors and timeouts from o…
Browse files Browse the repository at this point in the history
…ther erros.
  • Loading branch information
antirez committed Apr 2, 2012
1 parent f8ea19e commit 31f2ecf
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/cluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -1614,7 +1614,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;
}

Expand Down Expand Up @@ -1685,19 +1685,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;
Expand Down

0 comments on commit 31f2ecf

Please sign in to comment.