File tree Expand file tree Collapse file tree 5 files changed +23
-12
lines changed
Expand file tree Collapse file tree 5 files changed +23
-12
lines changed Original file line number Diff line number Diff line change @@ -723,9 +723,11 @@ class Manager : public DoutPrefixProvider {
723723 throw err;
724724 }
725725 });
726- const auto rc = ceph_pthread_setname (workers.back ().native_handle (),
727- (WORKER_THREAD_NAME+std::to_string (worker_id)).c_str ());
728- ceph_assert (rc == 0 );
726+ const auto thread_name = WORKER_THREAD_NAME+std::to_string (worker_id);
727+ if (const auto rc = ceph_pthread_setname (workers.back ().native_handle (), thread_name.c_str ()); rc != 0 ) {
728+ ldpp_dout (this , 1 ) << " ERROR: failed to set notification manager thread name to: " << thread_name
729+ << " . error: " << rc << dendl;
730+ }
729731 }
730732 ldpp_dout (this , 10 ) << " INfO: started notification manager with: " << worker_count << " workers" << dendl;
731733 }
Original file line number Diff line number Diff line change @@ -836,8 +836,11 @@ class Manager {
836836 // when a new connection is added.
837837 connections.max_load_factor (10.0 );
838838 // give the runner thread a name for easier debugging
839- const auto rc = ceph_pthread_setname (runner.native_handle (), " amqp_manager" );
840- ceph_assert (rc==0 );
839+ const char * thread_name = " amqp_manager" ;
840+ if (const auto rc = ceph_pthread_setname (runner.native_handle (), thread_name); rc != 0 ) {
841+ ldout (cct, 1 ) << " ERROR: failed to set amqp manager thread name to: " << thread_name
842+ << " . error: " << rc << dendl;
843+ }
841844 }
842845
843846 // non copyable
Original file line number Diff line number Diff line change @@ -527,8 +527,11 @@ class Manager {
527527 // when a new connection is added.
528528 connections.max_load_factor (10.0 );
529529 // give the runner thread a name for easier debugging
530- const auto rc = ceph_pthread_setname (runner.native_handle (), " kafka_manager" );
531- ceph_assert (rc==0 );
530+ const char * thread_name = " kafka_manager" ;
531+ if (const auto rc = ceph_pthread_setname (runner.native_handle (), thread_name); rc != 0 ) {
532+ ldout (cct, 1 ) << " ERROR: failed to set kafka manager thread name to: " << thread_name
533+ << " . error: " << rc << dendl;
534+ }
532535 }
533536
534537 // non copyable
Original file line number Diff line number Diff line change @@ -83,9 +83,11 @@ void Background::start() {
8383 }
8484 started = true ;
8585 runner = std::thread (&Background::run, this );
86- const auto rc = ceph_pthread_setname (runner.native_handle (),
87- " lua_background" );
88- ceph_assert (rc == 0 );
86+ const char * thread_name = " lua_background" ;
87+ if (const auto rc = ceph_pthread_setname (runner.native_handle (), thread_name); rc != 0 ) {
88+ ldout (cct, 1 ) << " ERROR: failed to set lua background thread name to: " << thread_name
89+ << " . error: " << rc << dendl;
90+ }
8991}
9092
9193void Background::pause () {
Original file line number Diff line number Diff line change @@ -286,7 +286,8 @@ class ActiveRateLimiter : public DoutPrefix {
286286 void start () {
287287 ldpp_dout (this , 20 ) << " starting ratelimit_gc thread" << dendl;
288288 runner = std::thread (&ActiveRateLimiter::replace_active, this );
289- const auto rc = ceph_pthread_setname (runner.native_handle (), " ratelimit_gc" );
290- ceph_assert (rc==0 );
289+ if (const auto rc = ceph_pthread_setname (runner.native_handle (), " ratelimit_gc" ); rc != 0 ) {
290+ ldpp_dout (this , 1 ) << " ERROR: failed to set ratelimit_gc thread name. error: " << rc << dendl;
291+ }
291292 }
292293};
You can’t perform that action at this time.
0 commit comments