summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@inktank.com>2012-12-18 13:53:09 -0800
committerYehuda Sadeh <yehuda@inktank.com>2012-12-20 10:13:16 -0800
commita803159b02abec070ef2561591d4779fb894af42 (patch)
treed3cbca2e21949cc09b6af314a110be4f313cb0c2
parent92b59e90590aee501ae090adebf58978912f9dd3 (diff)
downloadceph-a803159b02abec070ef2561591d4779fb894af42.tar.gz
rgw: configurable exit timeout
Fixes: #3638 rgw exit timeout secs : number of seconds to wait for process to exit cleanly before forcing exit. If set to 0, it'l wait indefinitely. Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
-rw-r--r--src/common/config_opts.h1
-rw-r--r--src/rgw/rgw_main.cc4
2 files changed, 4 insertions, 1 deletions
diff --git a/src/common/config_opts.h b/src/common/config_opts.h
index 720dbe38fa5..a25c231a097 100644
--- a/src/common/config_opts.h
+++ b/src/common/config_opts.h
@@ -488,6 +488,7 @@ OPTION(rgw_s3_success_create_obj_status, OPT_INT, 0) // alternative success stat
OPTION(rgw_resolve_cname, OPT_BOOL, false) // should rgw try to resolve hostname as a dns cname record
OPTION(rgw_obj_stripe_size, OPT_INT, 4 << 20)
OPTION(rgw_extended_http_attrs, OPT_STR, "") // list of extended attrs that can be set on objects (beyond the default)
+OPTION(rgw_exit_timeout_secs, OPT_INT, 120) // how many seconds to wait for process to go down before exiting unconditionally
OPTION(mutex_perf_counter, OPT_BOOL, false) // enable/disable mutex perf counter
diff --git a/src/rgw/rgw_main.cc b/src/rgw/rgw_main.cc
index 29c10dd0eeb..4e99f60ccb3 100644
--- a/src/rgw/rgw_main.cc
+++ b/src/rgw/rgw_main.cc
@@ -252,7 +252,9 @@ static void godown_handler(int signum)
FCGX_ShutdownPending();
pprocess->close_fd();
signal(signum, sighandler_usr1);
- alarm(5);
+ uint64_t secs = g_ceph_context->_conf->rgw_exit_timeout_secs;
+ if (secs)
+ alarm(secs);
}
static void godown_alarm(int signum)