Skip to content

Commit ba8be21

Browse files
committed
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 <[email protected]>
1 parent 7aec001 commit ba8be21

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/rgw/rgw_asio_frontend.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,15 +1100,18 @@ void AsioFrontend::join()
11001100

11011101
void AsioFrontend::pause()
11021102
{
1103-
ldout(ctx(), 4) << "frontend pausing connections..." << dendl;
1103+
ldout(ctx(), 4) << "frontend pausing, closing connections..." << dendl;
11041104

11051105
// cancel pending calls to accept(), but don't close the sockets
11061106
boost::system::error_code ec;
11071107
for (auto& l : listeners) {
11081108
l.acceptor.cancel(ec);
11091109
}
11101110

1111-
// pause and wait for outstanding requests to complete
1111+
// close all connections so outstanding requests fail quickly
1112+
connections.close(ec);
1113+
1114+
// pause and wait until outstanding requests complete
11121115
pause_mutex.lock(ec);
11131116

11141117
if (ec) {

0 commit comments

Comments
 (0)