]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds,mgr,mon: warn future respawn() copy-pasters to set thread name 26821/head
authorSage Weil <sage@redhat.com>
Thu, 7 Mar 2019 14:50:53 +0000 (08:50 -0600)
committerSage Weil <sage@redhat.com>
Thu, 7 Mar 2019 14:50:53 +0000 (08:50 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/mds/MDSDaemon.cc
src/mgr/MgrStandby.cc
src/mon/Monitor.cc

index c1bbeb820772e094312cecba6fdb68366403ab45..9b22a1a92a76a8c1c0f84a2d7a107b2491c9cafb 100644 (file)
@@ -1073,6 +1073,14 @@ void MDSDaemon::suicide()
 
 void MDSDaemon::respawn()
 {
+  // --- WARNING TO FUTURE COPY/PASTERS ---
+  // You must also add a call like
+  //
+  //   ceph_pthread_setname(pthread_self(), "ceph-mds");
+  //
+  // to main() so that /proc/$pid/stat field 2 contains "(ceph-mds)"
+  // instead of "(exe)", so that killall (and log rotation) will work.
+
   dout(1) << "respawn!" << dendl;
 
   /* Dump recent in case the MDS was stuck doing something which caused it to
index e0c80e0b00e1df6059ce876d48112d21d74e6047..061ddd0f9b9ecf3819068fd5775351c9cfaaf267 100644 (file)
@@ -302,6 +302,14 @@ void MgrStandby::shutdown()
 
 void MgrStandby::respawn()
 {
+  // --- WARNING TO FUTURE COPY/PASTERS ---
+  // You must also add a call like
+  //
+  //   ceph_pthread_setname(pthread_self(), "ceph-mgr");
+  //
+  // to main() so that /proc/$pid/stat field 2 contains "(ceph-mgr)"
+  // instead of "(exe)", so that killall (and log rotation) will work.
+
   char *new_argv[orig_argc+1];
   dout(1) << " e: '" << orig_argv[0] << "'" << dendl;
   for (int i=0; i<orig_argc; i++) {
index 8592a4667ae431e4fc97ec44802394a18e3f0cba..ae1fa50d80c8234d7e9119ebee1ac2898f8d3761 100644 (file)
@@ -1046,6 +1046,14 @@ void Monitor::wait_for_paxos_write()
 
 void Monitor::respawn()
 {
+  // --- WARNING TO FUTURE COPY/PASTERS ---
+  // You must also add a call like
+  //
+  //   ceph_pthread_setname(pthread_self(), "ceph-mon");
+  //
+  // to main() so that /proc/$pid/stat field 2 contains "(ceph-mon)"
+  // instead of "(exe)", so that killall (and log rotation) will work.
+
   dout(0) << __func__ << dendl;
 
   char *new_argv[orig_argc+1];