rgw: wait for completion only if not completion available

In a bucket aio operation, wait for completions only if there are no
completions available. Otherwise we might wait forever, as everything
already complete.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
This commit is contained in:
Yehuda Sadeh 2015-01-14 11:47:18 -08:00
parent a78a93e5a1
commit f3a57ee6a6

View File

@ -66,8 +66,11 @@ bool BucketIndexAioManager::wait_for_completions(int valid_ret_code,
lock.Unlock();
return false;
}
// Wait for AIO completion
cond.Wait(lock);
if (completions.empty()) {
// Wait for AIO completion
cond.Wait(lock);
}
// Clear the completed AIOs
map<int, librados::AioCompletion*>::iterator iter = completions.begin();