diff options
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/nfs/server/src/nfs.c | 22 | ||||
-rw-r--r-- | xlators/protocol/server/src/server.c | 20 |
2 files changed, 39 insertions, 3 deletions
diff --git a/xlators/nfs/server/src/nfs.c b/xlators/nfs/server/src/nfs.c index 4ab5cbc9077..04cf030dc12 100644 --- a/xlators/nfs/server/src/nfs.c +++ b/xlators/nfs/server/src/nfs.c @@ -967,6 +967,15 @@ nfs_init_state (xlator_t *this) goto free_foppool; } + ret = rpcsvc_set_outstanding_rpc_limit (nfs->rpcsvc, + this->options, + RPCSVC_DEF_NFS_OUTSTANDING_RPC_LIMIT); + if (ret < 0) { + gf_log (GF_NFS, GF_LOG_ERROR, + "Failed to configure outstanding-rpc-limit"); + goto free_foppool; + } + nfs->register_portmap = rpcsvc_register_portmap_enabled (nfs->rpcsvc); this->private = (void *)nfs; @@ -1210,6 +1219,17 @@ reconfigure (xlator_t *this, dict_t *options) "rpcsvc reconfigure options failed"); return (-1); } + + /* Reconfigure rpc.outstanding-rpc-limit */ + ret = rpcsvc_set_outstanding_rpc_limit (nfs->rpcsvc, + options, + RPCSVC_DEF_NFS_OUTSTANDING_RPC_LIMIT); + if (ret < 0) { + gf_log (GF_NFS, GF_LOG_ERROR, + "Failed to reconfigure outstanding-rpc-limit"); + return (-1); + } + regpmap = rpcsvc_register_portmap_enabled(nfs->rpcsvc); if (nfs->register_portmap != regpmap) { nfs->register_portmap = regpmap; @@ -1741,7 +1761,7 @@ struct volume_options options[] = { .type = GF_OPTION_TYPE_INT, .min = RPCSVC_MIN_OUTSTANDING_RPC_LIMIT, .max = RPCSVC_MAX_OUTSTANDING_RPC_LIMIT, - .default_value = TOSTRING(RPCSVC_DEFAULT_OUTSTANDING_RPC_LIMIT), + .default_value = TOSTRING(RPCSVC_DEF_NFS_OUTSTANDING_RPC_LIMIT), .description = "Parameter to throttle the number of incoming RPC " "requests from a client. 0 means no limit (can " "potentially run out of memory)" diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c index 56b83cb9a90..378aa393a50 100644 --- a/xlators/protocol/server/src/server.c +++ b/xlators/protocol/server/src/server.c @@ -746,7 +746,15 @@ reconfigure (xlator_t *this, dict_t *options) (void) rpcsvc_set_allow_insecure (rpc_conf, options); (void) rpcsvc_set_root_squash (rpc_conf, options); - (void) rpcsvc_set_outstanding_rpc_limit (rpc_conf, options); + + ret = rpcsvc_set_outstanding_rpc_limit (rpc_conf, options, + RPCSVC_DEFAULT_OUTSTANDING_RPC_LIMIT); + if (ret < 0) { + gf_log (this->name, GF_LOG_ERROR, + "Failed to reconfigure outstanding-rpc-limit"); + goto out; + } + list_for_each_entry (listeners, &(rpc_conf->listeners), list) { if (listeners->trans != NULL) { if (listeners->trans->reconfigure ) @@ -860,12 +868,20 @@ init (xlator_t *this) /* RPC related */ conf->rpc = rpcsvc_init (this, this->ctx, this->options, 0); if (conf->rpc == NULL) { - gf_log (this->name, GF_LOG_WARNING, + gf_log (this->name, GF_LOG_ERROR, "creation of rpcsvc failed"); ret = -1; goto out; } + ret = rpcsvc_set_outstanding_rpc_limit (conf->rpc, this->options, + RPCSVC_DEFAULT_OUTSTANDING_RPC_LIMIT); + if (ret < 0) { + gf_log (this->name, GF_LOG_ERROR, + "Failed to configure outstanding-rpc-limit"); + goto out; + } + ret = rpcsvc_create_listeners (conf->rpc, this->options, this->name); if (ret < 1) { |