mirror of https://gitee.com/bigwinds/arangodb
acquire mutex when serializing conductor state (#8620)
This commit is contained in:
parent
ffc05c05c0
commit
bccd2f3d58
|
@ -687,16 +687,15 @@ void Conductor::collectAQLResults(VPackBuilder& outBuilder) {
|
||||||
}
|
}
|
||||||
|
|
||||||
VPackBuilder Conductor::toVelocyPack() const {
|
VPackBuilder Conductor::toVelocyPack() const {
|
||||||
|
MUTEX_LOCKER(guard, _callbackMutex);
|
||||||
|
|
||||||
VPackBuilder result;
|
VPackBuilder result;
|
||||||
result.openObject();
|
result.openObject();
|
||||||
result.add("state", VPackValue(pregel::ExecutionStateNames[_state]));
|
result.add("state", VPackValue(pregel::ExecutionStateNames[_state]));
|
||||||
result.add("gss", VPackValue(_globalSuperstep));
|
result.add("gss", VPackValue(_globalSuperstep));
|
||||||
result.add("totalRuntime", VPackValue(totalRuntimeSecs()));
|
result.add("totalRuntime", VPackValue(totalRuntimeSecs()));
|
||||||
_aggregators->serializeValues(result);
|
_aggregators->serializeValues(result);
|
||||||
{
|
_statistics.serializeValues(result);
|
||||||
MUTEX_LOCKER(guard, _callbackMutex);
|
|
||||||
_statistics.serializeValues(result);
|
|
||||||
}
|
|
||||||
if (_state != ExecutionState::RUNNING) {
|
if (_state != ExecutionState::RUNNING) {
|
||||||
result.add("vertexCount", VPackValue(_totalVerticesCount));
|
result.add("vertexCount", VPackValue(_totalVerticesCount));
|
||||||
result.add("edgeCount", VPackValue(_totalEdgesCount));
|
result.add("edgeCount", VPackValue(_totalEdgesCount));
|
||||||
|
|
Loading…
Reference in New Issue