]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix for pause in beast frontend 18402/head
authorCasey Bodley <cbodley@redhat.com>
Thu, 19 Oct 2017 00:22:11 +0000 (20:22 -0400)
committerCasey Bodley <cbodley@redhat.com>
Thu, 19 Oct 2017 00:22:23 +0000 (20:22 -0400)
pause_for_new_config() was only stopping the listener on pause, but
existing keepalive connections would keep trying to read. this prevented
the frontend thread calls to io_service::run() from returning to
complete the pause

Fixes: http://tracker.ceph.com/issues/21831
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_asio_frontend.cc

index ee6be6256a5ba69b588c612a517b4d190eeee5db..27a9329112c031d5881665dd693730e98d7e6eca 100644 (file)
@@ -228,7 +228,10 @@ void AsioFrontend::stop()
   going_down = true;
 
   boost::system::error_code ec;
-  acceptor.close(ec); // unblock the run() threads
+  acceptor.close(ec);
+
+  // unblock the run() threads
+  service.stop();
 }
 
 void AsioFrontend::join()
@@ -247,9 +250,8 @@ void AsioFrontend::pause()
 {
   ldout(ctx(), 4) << "frontend pausing threads..." << dendl;
   pauser.pause(threads.size(), [=] {
-    // stop accepting but leave the port open
-    boost::system::error_code ec;
-    acceptor.cancel(ec);
+    // unblock the run() threads
+    service.stop();
   });
   ldout(ctx(), 4) << "frontend paused" << dendl;
 }
@@ -261,10 +263,6 @@ void AsioFrontend::unpause(RGWRados* const store,
   env.auth_registry = std::move(auth_registry);
   ldout(ctx(), 4) << "frontend unpaused" << dendl;
   service.reset();
-  acceptor.async_accept(peer_socket,
-                        [this] (boost::system::error_code ec) {
-                          return accept(ec);
-                        });
   pauser.unpause();
 }