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

Conflicts:
src/rgw/driver/rados/rgw_notify.cc

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 b1835016ec0eef21b9adc01ace1e43c67f74fc50..18449b51b0d813d75d4e50e3fe0cad999da0fd33 100644 (file)
@@ -505,9 +505,12 @@ 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 std::string 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) << "Started notification manager with: " << worker_count << " workers" << dendl;
     }
index 3014edd1db09dbfeb34621f9da0f1661896ce4e6..bc9e7ca48cbe8f3049e8c860a1be52056a774d2c 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 5b9d2f27cba4ae16517de57b9bfa91746ea951ed..3db0245cdd1045fc3f1c933146c3594906306afb 100644 (file)
@@ -530,8 +530,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 35de4a7e9a9bd675cd3360b1e31fc513854904c4..31c4e7013e420b02bb80f182cde290fc2c8e280f 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;
+      }
     }
 };