]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: do not assert on thread name setting failures 58072/head
authorYuval Lifshitz <ylifshit@ibm.com>
Tue, 11 Jun 2024 15:12:01 +0000 (15:12 +0000)
committerYuval Lifshitz <ylifshit@ibm.com>
Sun, 16 Jun 2024 14:09:20 +0000 (14:09 +0000)
Fixes: https://tracker.ceph.com/issues/64305
Signed-off-by: Yuval Lifshitz <ylifshit@ibm.com>
(cherry picked from commit 7e679576a8082e7a83db4ceb2120950fe445aa4a)

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 31555a564cab960df90a6739d4b2e4d5866c6e3a..31526db298c31017ee8f6366c2cba9bc2b18aef4 100644 (file)
@@ -728,9 +728,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 b551394de0f9ee23ae7d028fff6197f58da10b48..c7124cb6577e96bf2cd07ed4514e0261f3865842 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 6ffcb6cf633a2531e44fe3501eba2f1f65f71f32..8c93d6716d3b8544514f9b10ee38b30ac592793d 100644 (file)
@@ -535,8 +535,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;
+      }
     }
 };