mirror of
https://github.com/fluencelabs/redis
synced 2025-04-12 12:16:03 +00:00
slave now detect lost connection during SYNC, fixing Issue 173
This commit is contained in:
parent
778b2210a9
commit
b91d605a35
@ -428,9 +428,9 @@ int syncWithMaster(void) {
|
|||||||
int nread, nwritten;
|
int nread, nwritten;
|
||||||
|
|
||||||
nread = read(fd,buf,(dumpsize < 1024)?dumpsize:1024);
|
nread = read(fd,buf,(dumpsize < 1024)?dumpsize:1024);
|
||||||
if (nread == -1) {
|
if (nread <= 0) {
|
||||||
redisLog(REDIS_WARNING,"I/O error trying to sync with MASTER: %s",
|
redisLog(REDIS_WARNING,"I/O error trying to sync with MASTER: %s",
|
||||||
strerror(errno));
|
(nread == -1) ? strerror(errno) : "connection lost");
|
||||||
close(fd);
|
close(fd);
|
||||||
close(dfd);
|
close(dfd);
|
||||||
return REDIS_ERR;
|
return REDIS_ERR;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user