]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Make io_context runners noexcept 38852/head
authorAdam C. Emerson <aemerson@redhat.com>
Mon, 11 Jan 2021 20:46:27 +0000 (15:46 -0500)
committerAdam C. Emerson <aemerson@redhat.com>
Mon, 11 Jan 2021 21:05:22 +0000 (16:05 -0500)
Also don't catch and discard the error code from run, since we want
those errors.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/rgw/rgw_asio_frontend.cc
src/rgw/rgw_notify.cc

index e5334844f6361024cb2e91e7dd6f2c1beb1ffd03..7bafaf9e87552c2f286832997494d3e7ec4c6e7c 100644 (file)
@@ -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;
index 29b0c44093ad42718e1337aab0b40a1c053ce42f..b2e114623bf50362da2c8aff129699d05eba18cf 100644 (file)
@@ -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);