Wait for up to `rgw_exit_timeout_secs` for all outstanding requests
to complete before exiting unconditionally.
(new HTTP requests will not be accepted during this time.)
Fixes: https://tracker.ceph.com/issues/66205
Signed-off-by: Mark Kogan <mkogan@ibm.com>
services:
- rgw
with_legacy: true
+- name: rgw_graceful_stop
+ type: bool
+ level: advanced
+ desc: Delay the shutdown until all outstanding requests have completed
+ long_desc: Wait for up to `rgw_exit_timeout_secs` for all outstanding requests to complete
+ before exiting unconditionally. (new HTTP requests will not be accepted during this time.)
+ default: false
+ services:
+ - rgw
+ see_also:
+ - rgw_exit_timeout_secs
+ with_legacy: true
- name: rgw_get_obj_window_size
type: size
level: advanced
for (auto& listener : listeners) {
listener.acceptor.close(ec);
}
+
+ const bool graceful_stop{ g_ceph_context->_conf->rgw_graceful_stop };
+ if (graceful_stop) {
+ ldout(ctx(), 4) << "frontend pausing and waiting for outstanding requests to complete..." << dendl;
+ pause_mutex.lock(ec);
+ if (ec) {
+ ldout(ctx(), 1) << "frontend failed to pause: " << ec.message() << dendl;
+ } else {
+ ldout(ctx(), 4) << "frontend paused" << dendl;
+ }
+ ldout(ctx(), 4) << "frontend outstanding requests have completed" << dendl;
+ pause_mutex.unlock();
+ }
+
// close all connections
connections.close(ec);
pause_mutex.cancel();