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 <cbodley@redhat.com>
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;
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) {