From: Adam C. Emerson Date: Mon, 11 Jan 2021 20:46:27 +0000 (-0500) Subject: rgw: Make io_context runners noexcept X-Git-Tag: v17.1.0~3179^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4fb206eee18e26a58fedf3c7df4751c8840d4074;p=ceph.git rgw: Make io_context runners noexcept Also don't catch and discard the error code from run, since we want those errors. Signed-off-by: Adam C. Emerson --- diff --git a/src/rgw/rgw_asio_frontend.cc b/src/rgw/rgw_asio_frontend.cc index e5334844f636..7bafaf9e8755 100644 --- a/src/rgw/rgw_asio_frontend.cc +++ b/src/rgw/rgw_asio_frontend.cc @@ -953,11 +953,12 @@ int AsioFrontend::run() work.emplace(boost::asio::make_work_guard(context)); for (int i = 0; i < thread_count; i++) { - threads.emplace_back([=] { + threads.emplace_back([=]() noexcept { // request warnings on synchronous librados calls in this thread is_asio_thread = true; - boost::system::error_code ec; - context.run(ec); + // Have uncaught exceptions kill the process and give a + // stacktrace, not be swallowed. + context.run(); }); } return 0; diff --git a/src/rgw/rgw_notify.cc b/src/rgw/rgw_notify.cc index 29b0c44093ad..b2e114623bf5 100644 --- a/src/rgw/rgw_notify.cc +++ b/src/rgw/rgw_notify.cc @@ -483,7 +483,7 @@ public: // start the worker threads to do the actual queue processing const std::string WORKER_THREAD_NAME = "notif-worker"; for (auto worker_id = 0U; worker_id < worker_count; ++worker_id) { - workers.emplace_back([this]() { io_context.run(); }); + workers.emplace_back([this]() noexcept { io_context.run(); }); const auto rc = ceph_pthread_setname(workers.back().native_handle(), (WORKER_THREAD_NAME+std::to_string(worker_id)).c_str()); ceph_assert(rc == 0);