From: Casey Bodley Date: Thu, 19 Oct 2017 00:22:11 +0000 (-0400) Subject: rgw: fix for pause in beast frontend X-Git-Tag: v13.0.1~385^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c64ac823adfb6d717570d3d3e82b89ea73dc3a77;p=ceph.git rgw: fix for pause in beast frontend 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 --- diff --git a/src/rgw/rgw_asio_frontend.cc b/src/rgw/rgw_asio_frontend.cc index ee6be6256a5..27a9329112c 100644 --- a/src/rgw/rgw_asio_frontend.cc +++ b/src/rgw/rgw_asio_frontend.cc @@ -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(); }