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>
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;
// 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);