diff --git a/arangod/Aql/Query.cpp b/arangod/Aql/Query.cpp index 1faa634b31..a8e865059a 100644 --- a/arangod/Aql/Query.cpp +++ b/arangod/Aql/Query.cpp @@ -151,7 +151,8 @@ Query::Query (triagens::arango::ApplicationV8* applicationV8, _part(part), _contextOwnedByExterior(contextOwnedByExterior) { - // std::cout << TRI_CurrentThreadId() << ", QUERY " << this << " CTOR: " << queryString << "\r\n"; + // std::cout << TRI_CurrentThreadId() << ", QUERY " << this << " CTOR: " << queryString << "\n"; + TRI_ASSERT(_vocbase != nullptr); if (profiling()) { @@ -198,6 +199,8 @@ Query::Query (triagens::arango::ApplicationV8* applicationV8, _part(part), _contextOwnedByExterior(contextOwnedByExterior) { + // std::cout << TRI_CurrentThreadId() << ", QUERY " << this << " CTOR (JSON): " << _queryJson.toString() << "\n"; + TRI_ASSERT(_vocbase != nullptr); if (profiling()) { diff --git a/arangod/Aql/QueryRegistry.cpp b/arangod/Aql/QueryRegistry.cpp index ed793839ee..f45919c877 100644 --- a/arangod/Aql/QueryRegistry.cpp +++ b/arangod/Aql/QueryRegistry.cpp @@ -120,9 +120,10 @@ void QueryRegistry::insert (QueryId id, if (Transaction::_makeNolockHeaders == query->engine()->lockedShards()) { Transaction::_makeNolockHeaders = nullptr; } - else { - LOG_WARNING("Found strange lockedShards in thread!"); - } + // else { + // We have not set it, just leave it alone. This happens in particular + // on the DBServers, who do not set lockedShards() themselves. + // } } } else { @@ -207,7 +208,15 @@ void QueryRegistry::close (TRI_vocbase_t* vocbase, QueryId id, double ttl) { Transaction::_makeNolockHeaders = nullptr; } else { - LOG_WARNING("Found strange lockedShards in thread!"); + if (Transaction::_makeNolockHeaders != nullptr) { + if (Transaction::_makeNolockHeaders == qi->_query->engine()->lockedShards()) { + Transaction::_makeNolockHeaders = nullptr; + } + // else { + // We have not set it, just leave it alone. This happens in particular + // on the DBServers, who do not set lockedShards() themselves. + // } + } } }