1
0
Fork 0

fixed segfaults when running cluster AQL queries in console thread

This commit is contained in:
Jan Steemann 2015-05-05 17:58:10 +02:00
parent c677ea8b88
commit 4cc1e854c1
1 changed files with 10 additions and 2 deletions

View File

@ -6803,7 +6803,12 @@ ClusterCommResult* RemoteBlock::sendRequest (
headers.emplace(make_pair("Shard-Id", _ownName));
}
triagens::rest::DispatcherThread::currentDispatcherThread->blockThread();
auto currentThread = triagens::rest::DispatcherThread::currentDispatcherThread;
if (currentThread != nullptr) {
triagens::rest::DispatcherThread::currentDispatcherThread->blockThread();
}
auto result = cc->syncRequest(clientTransactionId,
coordTransactionId,
_server,
@ -6814,7 +6819,10 @@ ClusterCommResult* RemoteBlock::sendRequest (
body,
headers,
defaultTimeOut);
triagens::rest::DispatcherThread::currentDispatcherThread->unblockThread();
if (currentThread != nullptr) {
triagens::rest::DispatcherThread::currentDispatcherThread->unblockThread();
}
return result;
LEAVE_BLOCK