]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/beast: realm reload closes connections so requests drain quickly
authorCasey Bodley <cbodley@redhat.com>
Wed, 22 May 2024 18:52:03 +0000 (14:52 -0400)
committerCasey Bodley <cbodley@redhat.com>
Wed, 22 May 2024 19:16:39 +0000 (15:16 -0400)
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>
src/rgw/rgw_asio_frontend.cc

index ace3b7aff49e9a4d3424952946ceeb8ff4b8aa0f..e7a49f0d54c4ff3187b5639ead1f9127cc1acbd1 100644 (file)
@@ -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) {