]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: configurable exit timeout
authorYehuda Sadeh <yehuda@inktank.com>
Tue, 18 Dec 2012 21:53:09 +0000 (13:53 -0800)
committerYehuda Sadeh <yehuda@inktank.com>
Thu, 20 Dec 2012 18:13:16 +0000 (10:13 -0800)
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>
src/common/config_opts.h
src/rgw/rgw_main.cc

index 720dbe38fa571abd95adc8e626df106f6e98bf99..a25c231a09775db637049f0f2cda7c7aa30814a8 100644 (file)
@@ -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
 
index 29c10dd0eeb842fa2706bbcf44e84ad4c170f6af..4e99f60ccb3a9480992e2493f84be0ea080ef868 100644 (file)
@@ -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)