diff options
Diffstat (limited to 'src/rgw/driver/rados/rgw_notify.cc')
-rw-r--r-- | src/rgw/driver/rados/rgw_notify.cc | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/rgw/driver/rados/rgw_notify.cc b/src/rgw/driver/rados/rgw_notify.cc index 7b31fd72bd4..5734284d1a3 100644 --- a/src/rgw/driver/rados/rgw_notify.cc +++ b/src/rgw/driver/rados/rgw_notify.cc @@ -21,6 +21,7 @@ #include "common/dout.h" #include "rgw_url.h" #include <chrono> +#include <fmt/format.h> #define dout_subsys ceph_subsys_rgw_notification @@ -769,9 +770,10 @@ 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]() { + workers.emplace_back([this,worker_id]() { + const auto thread_name = fmt::format("notif-worker-{}", worker_id); + ceph_pthread_setname(thread_name.c_str()); try { io_context.run(); } catch (const std::exception& err) { @@ -779,11 +781,6 @@ public: throw err; } }); - const auto thread_name = WORKER_THREAD_NAME+std::to_string(worker_id); - if (const auto rc = ceph_pthread_setname(workers.back().native_handle(), thread_name.c_str()); rc != 0) { - ldpp_dout(this, 1) << "ERROR: failed to set notification manager thread name to: " << thread_name - << ". error: " << rc << dendl; - } } ldpp_dout(this, 10) << "INfO: started notification manager with: " << worker_count << " workers" << dendl; } |