summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCsaba Henk <csaba@redhat.com>2012-09-08 00:53:52 +0200
committerAnand Avati <avati@redhat.com>2013-01-21 22:25:53 -0800
commit4fdc84da10104ef9bd3c2c7015e427056d32ccc5 (patch)
treeda36d1310714748cc1c8ca8885095e90a47065ee
parent777d395feaa082a69e32d985bbc1cca3d3dad077 (diff)
geo-rep / glusterd: do non-blocking connect to checkpoint service
glusterd should not hang if gsyncd ends up in some weird state Change-Id: Ic141daa0cd05d515848c8b6c25702418e15b7599 BUG: 826512 Signed-off-by: Csaba Henk <csaba@redhat.com> Reviewed-on: http://review.gluster.org/3919 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-geo-rep.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
index b1c64bb5300..9ded1ebea52 100644
--- a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
+++ b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
@@ -1433,6 +1433,11 @@ glusterd_gsync_fetch_status_extra (char *path, char *buf, size_t blen)
s = socket(AF_UNIX, SOCK_STREAM, 0);
if (s == -1)
return -1;
+ ret = fcntl (s, F_GETFL);
+ if (ret != -1)
+ ret = fcntl (s, F_SETFL, ret | O_NONBLOCK);
+ if (ret == -1)
+ goto out;
ret = connect (s, (struct sockaddr *)&sa, sizeof (sa));
if (ret == -1)