diff options
author | Kaushal M <kaushal@redhat.com> | 2012-08-17 13:12:33 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2012-08-17 01:13:01 -0700 |
commit | 30a9ebd91339f36d092f46bbba116fa4047fb8c5 (patch) | |
tree | 418fc23b53d2e12d9db196cfb43477098050d520 /xlators/mgmt/glusterd/src/glusterd-handler.c | |
parent | b96e499e9e290547a655072fede969f51854e2d8 (diff) |
rpc: Reduce frame-timeout for glusterd connections
Reduce frame-timeout for glusterd connections from 30mins to 10 mins. 30mins is
too long when compared to cli timeout of 2mins. Changing to 10mins reduces the
disparity between cli and glusterd.
Also, fix glusterfs_submit_reply() so that a reply is sent even if serialize
failed.
BUG: 843003
Change-Id: Ie8d5ec16fbbb54318a5935a47065e66fd3338b87
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.com/3812
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-handler.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-handler.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c index 2dcfd2814..2e50b1c0e 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handler.c +++ b/xlators/mgmt/glusterd/src/glusterd-handler.c @@ -2106,8 +2106,8 @@ glusterd_transport_keepalive_options_get (int *interval, int *time) } int -glusterd_transport_inet_keepalive_options_build (dict_t **options, - const char *hostname, int port) +glusterd_transport_inet_options_build (dict_t **options, const char *hostname, + int port) { dict_t *dict = NULL; int32_t interval = -1; @@ -2119,10 +2119,25 @@ glusterd_transport_inet_keepalive_options_build (dict_t **options, if (!port) port = GLUSTERD_DEFAULT_PORT; + + /* Build default transport options */ ret = rpc_transport_inet_options_build (&dict, hostname, port); if (ret) goto out; + /* Set frame-timeout to 10mins. Default timeout of 30 mins is too long + * when compared to 2 mins for cli timeout. This ensures users don't + * wait too long after cli timesout before being able to resume normal + * operations + */ + ret = dict_set_int32 (dict, "frame-timeout", 600); + if (ret) { + gf_log ("glusterd", GF_LOG_ERROR, + "Failed to set frame-timeout"); + goto out; + } + + /* Set keepalive options */ glusterd_transport_keepalive_options_get (&interval, &time); if ((interval > 0) || (time > 0)) @@ -2168,8 +2183,7 @@ glusterd_friend_add (const char *hoststr, int port, peerctx->peerinfo = *friend; - ret = glusterd_transport_inet_keepalive_options_build (&options, - hoststr, port); + ret = glusterd_transport_inet_options_build (&options, hoststr, port); if (ret) goto out; |