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>
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();