1
0
Fork 0

Merge branch 'devel' of https://github.com/arangodb/arangodb into spdvpk

This commit is contained in:
Jan Steemann 2016-03-22 12:01:47 +01:00
commit 34057af3bc
1 changed files with 22 additions and 0 deletions

View File

@ -1126,6 +1126,28 @@ void ClusterCommThread::run() {
}
}
if (op->result.single) {
// For single requests this is it, either it worked and is ready
// or there was an error (timeout or other). If there is a callback,
// we have to call it now:
if (nullptr != op->callback.get()) {
if (op->result.status == CL_COMM_SENDING) {
op->result.status = CL_COMM_SENT;
}
if ((*op->callback.get())(&op->result)) {
// This is fully processed, so let's remove it from the queue:
CONDITION_LOCKER(locker, cc->somethingToSend);
auto i = cc->toSendByOpID.find(op->result.operationID);
TRI_ASSERT(i != cc->toSendByOpID.end());
auto q = i->second;
cc->toSendByOpID.erase(i);
cc->toSend.erase(q);
delete op;
continue; // do not move to the received queue but forget it
}
}
}
cc->moveFromSendToReceived(op->result.operationID);
// Potentially it was dropped in the meantime, then we forget about it.
}