diff --git a/arangod/GeneralServer/GeneralCommTask.cpp b/arangod/GeneralServer/GeneralCommTask.cpp index 3ce2d0dd78..be80e70f8b 100644 --- a/arangod/GeneralServer/GeneralCommTask.cpp +++ b/arangod/GeneralServer/GeneralCommTask.cpp @@ -455,10 +455,13 @@ bool GeneralCommTask::handleRequestSync(std::shared_ptr handler) { return false; } + RequestStatistics::SET_QUEUE_START(handler->statistics(), SchedulerFeature::SCHEDULER->queueStatistics()._queued); + // queue the operation in the scheduler, and make it eligible for direct execution // only if the current CommTask type allows it (HttpCommTask: yes, VstCommTask: no) // and there is currently only a single client handled by the IoContext bool ok = SchedulerFeature::SCHEDULER->queue(handler->getRequestLane(), [self = shared_from_this(), handler]() { + RequestStatistics::SET_QUEUE_END(handler->statistics()); auto thisPtr = static_cast(self.get()); thisPtr->handleRequestDirectly(basics::ConditionalLocking::DoLock, handler); }, allowDirectHandling() && _peer->clients() == 1); @@ -473,7 +476,7 @@ bool GeneralCommTask::handleRequestSync(std::shared_ptr handler) { } // Just run the handler, could have been called in a different thread -void GeneralCommTask::handleRequestDirectly(bool doLock, std::shared_ptr handler) { +void GeneralCommTask::handleRequestDirectly(bool doLock, std::shared_ptr const& handler) { TRI_ASSERT(doLock || _peer->runningInThisThread()); if (application_features::ApplicationServer::isStopping()) { diff --git a/arangod/GeneralServer/GeneralCommTask.h b/arangod/GeneralServer/GeneralCommTask.h index 519b996af1..cbd67078b7 100644 --- a/arangod/GeneralServer/GeneralCommTask.h +++ b/arangod/GeneralServer/GeneralCommTask.h @@ -156,7 +156,7 @@ class GeneralCommTask : public SocketTask { private: bool handleRequestSync(std::shared_ptr); - void handleRequestDirectly(bool doLock, std::shared_ptr); + void handleRequestDirectly(bool doLock, std::shared_ptr const&); bool handleRequestAsync(std::shared_ptr, uint64_t* jobId = nullptr); }; } // namespace rest diff --git a/scripts/startLocalCluster.sh b/scripts/startLocalCluster.sh index 2ec6c87fbd..932dba6af4 100755 --- a/scripts/startLocalCluster.sh +++ b/scripts/startLocalCluster.sh @@ -156,7 +156,7 @@ for aid in `seq 0 $(( $NRAGENTS - 1 ))`; do --server.endpoint $TRANSPORT://$ENDPOINT:$PORT \ --server.statistics false \ --log.file cluster/$PORT.log \ - --log.force-direct true \ + --log.force-direct true \ --log.level $LOG_LEVEL_AGENCY \ --javascript.allow-admin-execute true \ $STORAGE_ENGINE \