]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
radosgw: stop startup timer on failed start
authorSage Weil <sage@inktank.com>
Thu, 14 Jun 2012 22:09:16 +0000 (15:09 -0700)
committerSage Weil <sage@inktank.com>
Thu, 14 Jun 2012 22:09:16 +0000 (15:09 -0700)
This fixes crashes like

    -1> 2012-06-14 15:04:31.733009 7f544e18c780 -1 Couldn't init storage provider (RADOS)
     0> 2012-06-14 15:04:31.734110 7f544e18c780 -1 common/Timer.cc: In function 'SafeTimer::~SafeTimer()' thread 7f544e18c780 time 2012-06-14 15:04:31.733020
common/Timer.cc: 57: FAILED assert(thread == __null)

 ceph version 0.47.2-481-g6f30f1f (commit:6f30f1fcdecd6c9390d4678c754dadd305165e3e)
 1: (ceph::__ceph_assert_fail(char const*, char const*, int, char const*)+0x80) [0x5399a0]
 2: (SafeTimer::~SafeTimer()+0x39) [0x533e77]
 3: (main()+0x6f5) [0x51bc9d]
 4: (__libc_start_main()+0xfd) [0x7f544b38eead]
 5: /home/sage/src/ceph/src/.libs/lt-radosgw() [0x4f9e09]
 NOTE: a copy of the executable, or `objdump -rdS <executable>` is needed to interpret this.

Signed-off-by: Sage Weil <sage@inktank.com>
src/rgw/rgw_main.cc

index 3c29de420626de1f1e3c44bccf45ab42a8b26392..44a6f6c26a5646a8f963457758f123eebe072c6b 100644 (file)
@@ -418,21 +418,23 @@ int main(int argc, const char **argv)
   sighandler_term = signal(SIGTERM, godown_alarm);
   
   RGWStoreManager store_manager;
-  
+
+  int r = 0;
   if (!store_manager.init(g_ceph_context)) {
     derr << "Couldn't init storage provider (RADOS)" << dendl;
-    return EIO;
+    r = EIO;
   }
-  
-  int r = rgw_perf_start(g_ceph_context);
-  if (r < 0)
-    return 1;
+  if (!r)
+    r = rgw_perf_start(g_ceph_context);
 
   mutex.Lock();
   init_timer.cancel_all_events();
   init_timer.shutdown();
   mutex.Unlock();
 
+  if (r) 
+    return 1;
+
   rgw_log_usage_init(g_ceph_context);
 
   RGWProcess process(g_ceph_context, g_conf->rgw_thread_pool_size);