1
0
Fork 0

acquire mutex when serializing conductor state (#8620)

This commit is contained in:
Jan 2019-03-29 09:23:34 +01:00 committed by Frank Celler
parent ffc05c05c0
commit bccd2f3d58
1 changed files with 3 additions and 4 deletions

View File

@ -687,16 +687,15 @@ void Conductor::collectAQLResults(VPackBuilder& outBuilder) {
}
VPackBuilder Conductor::toVelocyPack() const {
MUTEX_LOCKER(guard, _callbackMutex);
VPackBuilder result;
result.openObject();
result.add("state", VPackValue(pregel::ExecutionStateNames[_state]));
result.add("gss", VPackValue(_globalSuperstep));
result.add("totalRuntime", VPackValue(totalRuntimeSecs()));
_aggregators->serializeValues(result);
{
MUTEX_LOCKER(guard, _callbackMutex);
_statistics.serializeValues(result);
}
_statistics.serializeValues(result);
if (_state != ExecutionState::RUNNING) {
result.add("vertexCount", VPackValue(_totalVerticesCount));
result.add("edgeCount", VPackValue(_totalEdgesCount));