]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: do not assert on thread name setting failures 57969/head
authorYuval Lifshitz <ylifshit@ibm.com>
Tue, 11 Jun 2024 15:12:01 +0000 (15:12 +0000)
committerYuval Lifshitz <ylifshit@ibm.com>
Thu, 13 Jun 2024 08:38:24 +0000 (08:38 +0000)
Fixes: https://tracker.ceph.com/issues/64305
Signed-off-by: Yuval Lifshitz <ylifshit@ibm.com>
src/rgw/driver/rados/rgw_notify.cc
src/rgw/rgw_amqp.cc
src/rgw/rgw_kafka.cc
src/rgw/rgw_lua_background.cc
src/rgw/rgw_ratelimit.h

index dd94d3155f8cabeb73437bfc7b1284b644f7ff5b..bb0bb40e64bd347d38ce51451bfcda7a264e9540 100644 (file)
@@ -767,9 +767,11 @@ public:
           throw err;
         }
       });
-      const auto rc = ceph_pthread_setname(workers.back().native_handle(), 
-        (WORKER_THREAD_NAME+std::to_string(worker_id)).c_str());
-      ceph_assert(rc == 0);
+      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;
   }
index ea824b8295aca169832936026d4929963b637ab4..e676b7b044bc5e07c6ea3eceb3fe4d60eef29af0 100644 (file)
@@ -836,8 +836,11 @@ public:
       // when a new connection is added.
       connections.max_load_factor(10.0);
       // give the runner thread a name for easier debugging
-      const auto rc = ceph_pthread_setname(runner.native_handle(), "amqp_manager");
-      ceph_assert(rc==0);
+      const char* thread_name = "amqp_manager";
+      if (const auto rc = ceph_pthread_setname(runner.native_handle(), thread_name); rc != 0) {
+        ldout(cct, 1) << "ERROR: failed to set amqp manager thread name to: " << thread_name
+          << ". error: " << rc << dendl;
+      }
   }
 
   // non copyable
index 9a356d9c6f04e59009fda77b74a99a93a850698b..e54cd037a7f3ad6b19005711c518692cb563bbd9 100644 (file)
@@ -527,8 +527,11 @@ public:
       // when a new connection is added.
       connections.max_load_factor(10.0);
       // give the runner thread a name for easier debugging
-      const auto rc = ceph_pthread_setname(runner.native_handle(), "kafka_manager");
-      ceph_assert(rc==0);
+      const char* thread_name = "kafka_manager";
+      if (const auto rc = ceph_pthread_setname(runner.native_handle(), thread_name); rc != 0) {
+        ldout(cct, 1) << "ERROR: failed to set kafka manager thread name to: " << thread_name
+          << ". error: " << rc << dendl;
+      }
   }
 
   // non copyable
index 93c509a78cc78d873d52752d51612da0adea30d7..ef97a5d6f65ea018efe27d6eee96b0ef447afe24 100644 (file)
@@ -83,9 +83,11 @@ void Background::start() {
   }
   started = true;
   runner = std::thread(&Background::run, this);
-  const auto rc = ceph_pthread_setname(runner.native_handle(),
-      "lua_background");
-  ceph_assert(rc == 0);
+  const char* thread_name = "lua_background";
+  if (const auto rc = ceph_pthread_setname(runner.native_handle(), thread_name); rc != 0) {
+    ldout(cct, 1) << "ERROR: failed to set lua background thread name to: " << thread_name
+      << ". error: " << rc << dendl;
+  }
 }
 
 void Background::pause() {
index 2639d4d42749f0201426cc5ba71075eabcab777e..0db1813f050027e0cd4f17527bb71d0be6f4513a 100644 (file)
@@ -286,7 +286,8 @@ class ActiveRateLimiter : public DoutPrefix  {
     void start() {
       ldpp_dout(this, 20) << "starting ratelimit_gc thread" << dendl;
       runner = std::thread(&ActiveRateLimiter::replace_active, this);
-      const auto rc = ceph_pthread_setname(runner.native_handle(), "ratelimit_gc");
-      ceph_assert(rc==0);
+      if (const auto rc = ceph_pthread_setname(runner.native_handle(), "ratelimit_gc"); rc != 0) {
+        ldpp_dout(this, 1) << "ERROR: failed to set ratelimit_gc thread name. error: " << rc << dendl;
+      }
     }
 };