From: Casey Bodley Date: Wed, 22 May 2024 18:52:03 +0000 (-0400) Subject: rgw/beast: realm reload closes connections so requests drain quickly X-Git-Tag: v20.0.0~1509^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ba8be2179e8a8aef838ae4f8604e21dc84f33449;p=ceph.git rgw/beast: realm reload closes connections so requests drain quickly outstanding requests may take arbitrarily long to complete. instead of waiting for everything to complete successfully before pause() returns, close all client connections so their requests fail quickly this matches the behavior of stop() for radosgw shutdown/restart. this should help to minimize the downtime of realm reloads where the frontend isn't accepting connections or processing new requests Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_asio_frontend.cc b/src/rgw/rgw_asio_frontend.cc index ace3b7aff49e..e7a49f0d54c4 100644 --- a/src/rgw/rgw_asio_frontend.cc +++ b/src/rgw/rgw_asio_frontend.cc @@ -1100,7 +1100,7 @@ void AsioFrontend::join() void AsioFrontend::pause() { - ldout(ctx(), 4) << "frontend pausing connections..." << dendl; + ldout(ctx(), 4) << "frontend pausing, closing connections..." << dendl; // cancel pending calls to accept(), but don't close the sockets boost::system::error_code ec; @@ -1108,7 +1108,10 @@ void AsioFrontend::pause() l.acceptor.cancel(ec); } - // pause and wait for outstanding requests to complete + // close all connections so outstanding requests fail quickly + connections.close(ec); + + // pause and wait until outstanding requests complete pause_mutex.lock(ec); if (ec) {