From 0ccb63dbc52f66975205baf8452d2b57418da4aa Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Sat, 9 Oct 2010 07:41:14 +0000 Subject: set keepalive for client connections Signed-off-by: Raghavendra Bhat Signed-off-by: Vijay Bellur BUG: 1802 (Gluster volume creation failed) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1802 --- xlators/mgmt/glusterd/src/glusterd-handler.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c index ba9aeb8f95c..8254569658c 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handler.c +++ b/xlators/mgmt/glusterd/src/glusterd-handler.c @@ -2265,6 +2265,7 @@ glusterd_friend_add (const char *hoststr, int port, glusterd_peer_hostname_t *name = NULL; char *hostname = NULL; glusterd_peerctx_t *peerctx = NULL; + int32_t intvl = 0; priv = THIS->private; @@ -2312,6 +2313,26 @@ glusterd_friend_add (const char *hoststr, int port, goto out; } + ret = dict_get_int32 (THIS->options, + "transport.socket.keepalive-interval", + &intvl); + if (!ret) { + ret = dict_set_int32 (options, + "transport.socket.keepalive-interval", intvl); + if (ret) + goto out; + } + + ret = dict_get_int32 (THIS->options, + "transport.socket.keepalive-time", + &intvl); + if (!ret) { + ret = dict_set_int32 (options, + "transport.socket.keepalive-time", intvl); + if (ret) + goto out; + } + hostname = gf_strdup((char*)hoststr); if (!hostname) { ret = -1; -- cgit