]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: don't hold client_lock around objecter init
authorJohn Spray <john.spray@redhat.com>
Thu, 21 Jan 2016 13:24:29 +0000 (13:24 +0000)
committerJohn Spray <john.spray@redhat.com>
Thu, 21 Jan 2016 13:29:11 +0000 (13:29 +0000)
Because by doing so we establish a dependency
between client lock and admin socket lock.

Signed-off-by: John Spray <john.spray@redhat.com>
src/client/Client.cc

index a4a01a80b3a68bcf42c3df5c9d920d06d2f26f07..43ee69d6d4fe82a3e10d726654367dbc96fa85e5 100644 (file)
@@ -468,15 +468,13 @@ void Client::dump_status(Formatter *f)
 
 int Client::init()
 {
-  client_lock.Lock();
-  assert(!initialized);
-
   timer.init();
-
   objectcacher->start();
-
   objecter->init();
 
+  client_lock.Lock();
+  assert(!initialized);
+
   // ok!
   messenger->add_dispatcher_tail(objecter);
   messenger->add_dispatcher_tail(this);
@@ -608,9 +606,9 @@ void Client::shutdown()
   assert(initialized);
   initialized = false;
   timer.shutdown();
-  objecter->shutdown();
   client_lock.Unlock();
 
+  objecter->shutdown();
   objecter_finisher.wait_for_empty();
   objecter_finisher.stop();