int RGWCoroutinesManager::run(list<RGWCoroutinesStack *>& stacks)
{
+ int ret = 0;
int blocked_count = 0;
int interval_wait_count = 0;
RGWCoroutinesEnv env;
* these aren't really waiting for IOs
*/
while (blocked_count - interval_wait_count >= ops_window) {
- int ret = completion_mgr.get_next((void **)&blocked_stack);
+ ret = completion_mgr.get_next((void **)&blocked_stack);
if (ret < 0) {
ldout(cct, 0) << "ERROR: failed to clone shard, completion_mgr.get_next() returned ret=" << ret << dendl;
}
while (scheduled_stacks.empty() && blocked_count > 0) {
- int ret = completion_mgr.get_next((void **)&blocked_stack);
+ ret = completion_mgr.get_next((void **)&blocked_stack);
if (ret < 0) {
ldout(cct, 0) << "ERROR: failed to clone shard, completion_mgr.get_next() returned ret=" << ret << dendl;
}
if (going_down.read() > 0) {
ldout(cct, 5) << __func__ << "(): was stopped, exiting" << dendl;
- return -ECANCELED;
+ ret = -ECANCELED;
+ break;
}
handle_unblocked_stack(context_stacks, scheduled_stacks, blocked_stack, &blocked_count);
iter = scheduled_stacks.begin();
if (iter == scheduled_stacks.end()) {
iter = scheduled_stacks.begin();
}
+
+ ret = 0;
}
lock.get_write();
run_contexts.erase(run_context);
lock.unlock();
- return 0;
+ return ret;
}
int RGWCoroutinesManager::run(RGWCoroutine *op)
void init_sync_env(RGWMetaSyncEnv *env);
+ atomic_t going_down;
+
public:
RGWRemoteMetaLog(RGWRados *_store, RGWMetaSyncStatusManager *_sm) : RGWCoroutinesManager(_store->ctx(), _store->get_cr_registry()), store(_store),
conn(NULL), async_rados(nullptr),