summaryrefslogtreecommitdiffstats
path: root/src/rgw/rgw_asio_frontend.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/rgw/rgw_asio_frontend.cc')
-rw-r--r--src/rgw/rgw_asio_frontend.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/rgw/rgw_asio_frontend.cc b/src/rgw/rgw_asio_frontend.cc
index f80e40c70b6..30e1e77fd15 100644
--- a/src/rgw/rgw_asio_frontend.cc
+++ b/src/rgw/rgw_asio_frontend.cc
@@ -1156,6 +1156,20 @@ void AsioFrontend::stop()
// signal cancellation of accept()
listener.signal.emit(boost::asio::cancellation_type::terminal);
}
+
+ 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();