]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: move frontends initial init to after global_init() 33287/head
authorYehuda Sadeh <yehuda@redhat.com>
Sat, 29 Feb 2020 02:48:51 +0000 (18:48 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Sat, 29 Feb 2020 03:16:52 +0000 (19:16 -0800)
So that central config could be used

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_main.cc

index 56000999484f116f42c8e40e6e05468343dd5e81..a3ca40e2cdf39b9d792eb5439d44de7b03116d2f 100644 (file)
@@ -202,15 +202,24 @@ int radosgw_Main(int argc, const char **argv)
     exit(0);
   }
 
-  // First, let's determine which frontends are configured.
   int flags = CINIT_FLAG_UNPRIVILEGED_DAEMON_DEFAULTS;
   global_pre_init(
     &defaults, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_DAEMON,
     flags);
 
+  // Now that we've determined which frontend(s) to use, continue with global
+  // initialization. Passing false as the final argument ensures that
+  // global_pre_init() is not invoked twice.
+  // claim the reference and release it after subsequent destructors have fired
+  auto cct = global_init(&defaults, args, CEPH_ENTITY_TYPE_CLIENT,
+                        CODE_ENVIRONMENT_DAEMON,
+                        flags, "rgw_data", false);
+
+  // First, let's determine which frontends are configured.
   list<string> frontends;
-  g_conf().early_expand_meta(g_conf()->rgw_frontends, &cerr);
-  get_str_list(g_conf()->rgw_frontends, ",", frontends);
+  string rgw_frontends_str = g_conf().get_val<string>("rgw_frontends");
+  g_conf().early_expand_meta(rgw_frontends_str, &cerr);
+  get_str_list(rgw_frontends_str, ",", frontends);
   multimap<string, RGWFrontendConfig *> fe_map;
   list<RGWFrontendConfig *> configs;
   if (frontends.empty()) {
@@ -248,14 +257,6 @@ int radosgw_Main(int argc, const char **argv)
     fe_map.insert(pair<string, RGWFrontendConfig*>(framework, config));
   }
 
-  // Now that we've determined which frontend(s) to use, continue with global
-  // initialization. Passing false as the final argument ensures that
-  // global_pre_init() is not invoked twice.
-  // claim the reference and release it after subsequent destructors have fired
-  auto cct = global_init(&defaults, args, CEPH_ENTITY_TYPE_CLIENT,
-                        CODE_ENVIRONMENT_DAEMON,
-                        flags, "rgw_data", false);
-
   int numa_node = g_conf().get_val<int64_t>("rgw_numa_node");
   size_t numa_cpu_set_size = 0;
   cpu_set_t numa_cpu_set;