]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: return retcode of failing coroutine
authorYehuda Sadeh <yehuda@redhat.com>
Thu, 6 Aug 2015 23:11:34 +0000 (16:11 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Tue, 9 Feb 2016 21:40:53 +0000 (13:40 -0800)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_sync.cc
src/rgw/rgw_sync.h

index c0a27fb53f5b394b7dcc99798e4d4b706cbeafa4..6eef00f2bb1a75edbb7662741baae318c89120c6 100644 (file)
@@ -593,6 +593,7 @@ template <class T>
 int RGWSimpleRadosCoroutine<T>::request_complete()
 {
   int ret = req->get_ret_status();
+  retcode = ret;
   if (ret != -ENOENT) {
     if (ret < 0) {
       return ret;
@@ -633,6 +634,9 @@ public:
 
 int RGWReadSyncStatusCoroutine::handle_data(RGWMetaSyncGlobalStatus& data)
 {
+  if (retcode == -ENOENT) {
+    return retcode;
+  }
   spawn(new RGWSimpleRadosCoroutine<rgw_sync_marker>(async_rados, store, obj_ctx, store->get_zone_params().log_pool,
                                 "mdlog.state.0", &sync_marker));
   spawn(new RGWSimpleRadosCoroutine<rgw_sync_marker>(async_rados, store, obj_ctx, store->get_zone_params().log_pool,
@@ -965,6 +969,7 @@ int RGWCoroutinesManager::run(RGWCoroutine *op)
 {
   list<RGWCoroutinesStack *> stacks;
   RGWCoroutinesStack *stack = allocate_stack();
+  op->get();
   int r = stack->call(op);
   if (r < 0) {
     ldout(cct, 0) << "ERROR: stack->call() returned r=" << r << dendl;
@@ -978,6 +983,9 @@ int RGWCoroutinesManager::run(RGWCoroutine *op)
     ldout(cct, 0) << "ERROR: run(stacks) returned r=" << r << dendl;
   }
 
+  r = op->get_ret_status();
+  op->put();
+
   return r;
 }
 
index 39570bd93a2bc56022e9668e7ab5d65ea3fc96f9..e0922bb28a8532174dd58d7df909d9587135d9ec 100644 (file)
@@ -77,6 +77,10 @@ public:
   void set_retcode(int r) {
     retcode = r;
   }
+
+  int get_ret_status() {
+    return retcode;
+  }
 };
 
 class RGWCoroutinesStack {