diff options
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volume-set.c | 6 | ||||
-rw-r--r-- | xlators/performance/io-threads/src/io-threads.c | 18 | ||||
-rw-r--r-- | xlators/performance/io-threads/src/io-threads.h | 1 |
3 files changed, 25 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c index 3f4c5bbb686..24f4f62ce59 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c @@ -1559,6 +1559,12 @@ struct volopt_map_entry glusterd_volopt_map[] = { .option = "watchdog-secs", .op_version = 2 }, + { .key = "performance.iot-cleanup-disconnected-reqs", + .voltype = "performance/io-threads", + .option = "cleanup-disconnected-reqs", + .op_version = 2 + }, + /* Other perf xlators' options */ { .key = "performance.cache-size", diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c index 09ae02bf2ac..04d94691ba3 100644 --- a/xlators/performance/io-threads/src/io-threads.c +++ b/xlators/performance/io-threads/src/io-threads.c @@ -1138,8 +1138,12 @@ reconfigure (xlator_t *this, dict_t *options) GF_OPTION_RECONF ("least-rate-limit", conf->throttle.rate_limit, options, int32, out); + GF_OPTION_RECONF ("cleanup-disconnected-reqs", + conf->cleanup_disconnected_reqs, options, bool, out); + GF_OPTION_RECONF ("watchdog-secs", conf->watchdog_secs, options, int32, out); + if (conf->watchdog_secs > 0) { start_iot_watchdog (this); } else { @@ -1217,9 +1221,13 @@ init (xlator_t *this) conf->ac_iot_limit[IOT_PRI_LEAST], int32, out); GF_OPTION_INIT ("idle-time", conf->idle_time, int32, out); + GF_OPTION_INIT ("enable-least-priority", conf->least_priority, bool, out); + GF_OPTION_INIT ("cleanup-disconnected-reqs", + conf->cleanup_disconnected_reqs, bool, out); + GF_OPTION_INIT ("least-rate-limit", conf->throttle.rate_limit, int32, out); @@ -1321,6 +1329,10 @@ iot_disconnect_cbk (xlator_t *this, client_t *client) call_stub_t *next; iot_conf_t *conf = this->private; + if (!conf || !conf->cleanup_disconnected_reqs) { + goto out; + } + pthread_mutex_lock (&conf->mutex); for (i = 0; i < IOT_PRI_MAX; i++) { list_for_each_entry_safe (curr, next, &conf->reqs[i], list) { @@ -1336,6 +1348,7 @@ iot_disconnect_cbk (xlator_t *this, client_t *client) } pthread_mutex_unlock (&conf->mutex); +out: return 0; } @@ -1479,6 +1492,11 @@ struct volume_options options[] = { .description = "Number of seconds a queue must be stalled before " "starting an 'emergency' thread." }, + { .key = {"cleanup-disconnected-reqs"}, + .type = GF_OPTION_TYPE_BOOL, + .default_value = "off", + .description = "'Poison' queued requests when a client disconnects" + }, { .key = {NULL}, }, }; diff --git a/xlators/performance/io-threads/src/io-threads.h b/xlators/performance/io-threads/src/io-threads.h index 4056eb5fe09..4300cf673b2 100644 --- a/xlators/performance/io-threads/src/io-threads.h +++ b/xlators/performance/io-threads/src/io-threads.h @@ -83,6 +83,7 @@ struct iot_conf { gf_boolean_t watchdog_running; pthread_t watchdog_thread; gf_boolean_t queue_marked[IOT_PRI_MAX]; + gf_boolean_t cleanup_disconnected_reqs; }; typedef struct iot_conf iot_conf_t; |