]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
global_init: do not count threads before daemonize()
authorSage Weil <sage.weil@dreamhost.com>
Fri, 4 May 2012 01:50:42 +0000 (18:50 -0700)
committerGreg Farnum <gregory.farnum@dreamhost.com>
Fri, 4 May 2012 03:00:36 +0000 (20:00 -0700)
We were verifying that there was only 1 thread (the presumably main()) when
we call daemonize.  However, with the new logging code, we stop a thread
right before the check, and /proc apparently updates asynchronously such
that our attempt to count running threads gives us a bad answer.

Just remove this kludgey check; we'll have to catch this class of bugs
the hard way.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
src/global/global_init.cc

index a977fbe2bc1844499e823a3d6543ca2c25c34990..17f886cd6e98c183ca5603093a07e5af8b5f9430 100644 (file)
@@ -144,13 +144,6 @@ void global_init_daemonize(CephContext *cct, int flags)
   // stop log thread
   g_ceph_context->_log->stop();
 
-  int num_threads = Thread::get_num_threads();
-  if (num_threads > 1) {
-    derr << "global_init_daemonize: BUG: there are " << num_threads - 1
-        << " child threads already started that will now die!" << dendl;
-    exit(1);
-  }
-
   int ret = daemon(1, 1);
   if (ret) {
     ret = errno;