From a803159b02abec070ef2561591d4779fb894af42 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Tue, 18 Dec 2012 13:53:09 -0800 Subject: [PATCH] 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 --- src/common/config_opts.h | 1 + src/rgw/rgw_main.cc | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) 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)