diff options
author | Kaushal M <kaushal@redhat.com> | 2012-08-09 19:29:33 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2012-08-17 01:12:36 -0700 |
commit | 6930c6950f7b7a8186ebfcdf9ebcad11e90740c0 (patch) | |
tree | 1dc2f56fad7ede0eb9d6c50f499f7ac82023817b /xlators | |
parent | acf73966abd3ad3fe341a933f76c821e19fd7b95 (diff) | |
download | glusterfs-6930c6950f7b7a8186ebfcdf9ebcad11e90740c0.tar.gz glusterfs-6930c6950f7b7a8186ebfcdf9ebcad11e90740c0.tar.xz glusterfs-6930c6950f7b7a8186ebfcdf9ebcad11e90740c0.zip |
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.
Change-Id: Id5f68f2ff28ea7453d9a62429fe12aa0c0a66952
BUG: 843003
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.com/3803
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-handler.c | 22 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-rebalance.c | 16 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 16 |
3 files changed, 46 insertions, 8 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c index 8d24b08ab9..74a5bb5764 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handler.c +++ b/xlators/mgmt/glusterd/src/glusterd-handler.c @@ -2097,8 +2097,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; @@ -2110,10 +2110,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)) @@ -2159,8 +2174,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; diff --git a/xlators/mgmt/glusterd/src/glusterd-rebalance.c b/xlators/mgmt/glusterd/src/glusterd-rebalance.c index c9397b394a..73d6f602cb 100644 --- a/xlators/mgmt/glusterd/src/glusterd-rebalance.c +++ b/xlators/mgmt/glusterd/src/glusterd-rebalance.c @@ -313,7 +313,13 @@ glusterd_handle_defrag_start (glusterd_volinfo_t *volinfo, char *op_errstr, } sleep (5); - ret = rpc_clnt_transport_unix_options_build (&options, sockfile); + + /* Setting frame-timeout to 10mins (600seconds). + * Unix domain sockets ensures that the connection is reliable. The + * default timeout of 30mins used for unreliable network connections is + * too long for unix domain socket connections. + */ + ret = rpc_clnt_transport_unix_options_build (&options, sockfile, 600); if (ret) { gf_log (THIS->name, GF_LOG_ERROR, "Unix options build failed"); goto out; @@ -357,7 +363,13 @@ glusterd_rebalance_rpc_create (glusterd_volinfo_t *volinfo, LOCK_INIT (&defrag->lock); GLUSTERD_GET_DEFRAG_SOCK_FILE (sockfile, volinfo, priv); - ret = rpc_clnt_transport_unix_options_build (&options, sockfile); + + /* Setting frame-timeout to 10mins (600seconds). + * Unix domain sockets ensures that the connection is reliable. The + * default timeout of 30mins used for unreliable network connections is + * too long for unix domain socket connections. + */ + ret = rpc_clnt_transport_unix_options_build (&options, sockfile, 600); if (ret) { gf_log (THIS->name, GF_LOG_ERROR, "Unix options build failed"); goto out; diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 0267129b01..e10de75c63 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -1121,7 +1121,14 @@ glusterd_brick_connect (glusterd_volinfo_t *volinfo, glusterd_set_brick_socket_filepath (volinfo, brickinfo, socketpath, sizeof (socketpath)); - ret = rpc_clnt_transport_unix_options_build (&options, socketpath); + + /* Setting frame-timeout to 10mins (600seconds). + * Unix domain sockets ensures that the connection is reliable. + * The default timeout of 30mins used for unreliable network + * connections is too long for unix domain socket connections. + */ + ret = rpc_clnt_transport_unix_options_build (&options, + socketpath, 600); if (ret) goto out; ret = glusterd_rpc_create (&rpc, options, @@ -2812,8 +2819,13 @@ glusterd_nodesvc_connect (char *server, char *socketpath) { rpc = glusterd_nodesvc_get_rpc (server); if (rpc == NULL) { + /* Setting frame-timeout to 10mins (600seconds). + * Unix domain sockets ensures that the connection is reliable. + * The default timeout of 30mins used for unreliable network + * connections is too long for unix domain socket connections. + */ ret = rpc_clnt_transport_unix_options_build (&options, - socketpath); + socketpath, 600); if (ret) goto out; ret = glusterd_rpc_create (&rpc, options, |