diff options
author | Krishnan Parthasarathi <kparthas@redhat.com> | 2015-02-12 17:29:28 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2015-02-19 02:12:40 -0800 |
commit | ee9b0aab614b56aa8f3c8ed56ced88f769c0ee47 (patch) | |
tree | 476f33b2878e3922d2456a318d6c9abcecd1954c /xlators/protocol/client | |
parent | f099a87fd36b600ccb8268937d3cd7ca84799f77 (diff) |
client/server: fix reconfigure for event-threads option
Change-Id: Ica8bca13e4feb941e22651b642b848be165ccc9e
BUG: 1104462
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/9648
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/protocol/client')
-rw-r--r-- | xlators/protocol/client/src/client.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c index 32952b49fbb..b919e4c80a5 100644 --- a/xlators/protocol/client/src/client.c +++ b/xlators/protocol/client/src/client.c @@ -2560,20 +2560,15 @@ out: } int -client_check_event_threads (xlator_t *this, dict_t *options, clnt_conf_t *conf) +client_check_event_threads (xlator_t *this, clnt_conf_t *conf, int32_t old, + int32_t new) { - int ret = -1; - int eventthreads = 0; - - /* Read event-threads from the new configuration */ - ret = dict_get_int32 (options, "event-threads", &eventthreads); - if (!ret) { - conf->event_threads = eventthreads; - } - ret = event_reconfigure_threads (this->ctx->event_pool, - conf->event_threads); + if (old == new) + return 0; - return ret; + conf->event_threads = new; + return event_reconfigure_threads (this->ctx->event_pool, + conf->event_threads); } int @@ -2586,6 +2581,7 @@ reconfigure (xlator_t *this, dict_t *options) char *new_remote_subvol = NULL; char *old_remote_host = NULL; char *new_remote_host = NULL; + int32_t new_nthread = 0; conf = this->private; @@ -2595,7 +2591,10 @@ reconfigure (xlator_t *this, dict_t *options) GF_OPTION_RECONF ("ping-timeout", conf->opt.ping_timeout, options, int32, out); - ret = client_check_event_threads (this, options, conf); + GF_OPTION_RECONF ("event-threads", new_nthread, options, + int32, out); + ret = client_check_event_threads (this, conf, conf->event_threads, + new_nthread); if (ret) goto out; @@ -2679,7 +2678,8 @@ init (xlator_t *this) /* Set event threads to the configured default */ GF_OPTION_INIT("event-threads", conf->event_threads, int32, out); - ret = client_check_event_threads (this, this->options, conf); + ret = client_check_event_threads (this, conf, STARTING_EVENT_THREADS, + conf->event_threads); if (ret) goto out; |