]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librados: fix common_init_finish timing
authorSage Weil <sage@redhat.com>
Wed, 28 Feb 2018 21:37:34 +0000 (15:37 -0600)
committerSage Weil <sage@redhat.com>
Tue, 6 Mar 2018 20:44:50 +0000 (14:44 -0600)
Common_init_finish does start_service_thread and does
set_safe_to_start_threads() on the cct, which switches us to 'runtime'
mode where we can't accept many config options. Do that *after* we fetch
our config from the mon so that we can accept+set runtime options (and
not complain to stderr about it).

Signed-off-by: Sage Weil <sage@redhat.com>
src/librados/RadosClient.cc

index efbd6b563fb893ec571214a9efdfc96655727ffd..06436be1835dcafe609727f839c1c6910fabb830 100644 (file)
@@ -237,8 +237,6 @@ int librados::RadosClient::ping_monitor(const string mon_id, string *result)
 
 int librados::RadosClient::connect()
 {
-  common_init_finish(cct);
-
   int err;
 
   // already connected?
@@ -255,6 +253,8 @@ int librados::RadosClient::connect()
       return err;
   }
 
+  common_init_finish(cct);
+
   // get monmap
   err = monclient.build_initial_monmap();
   if (err < 0)