Commit c5019de0 authored by Akshay Bharambe's avatar Akshay Bharambe
Browse files

Merge branch 'devbranch' into ab_Release_v1.1.1

Fix: Panic On concurrent map r/w in statemdl
parents 78c3d514 b74d8d37
Branches
Tags
2 merge requests!219Add: Support for branches,!214Release v1.1.1
Showing with 6 additions and 0 deletions
......@@ -392,6 +392,12 @@ func collectStatistics() {
clientResponseData.ServicesState = stateCache
clientResponseData.QueryState = queryCache
// the marshall function reads data from clientResponseData.ServicesState and clientResponseData.QueryState
// as both are maps, we have passed a referrence of stateCache and queryCache respectively.
// The following lock guards these two underlying data structures.
stateMutex.Lock()
defer stateMutex.Unlock()
ba, marshalError := ffjson.Marshal(clientResponseData)
if errormdl.CheckErr(marshalError) != nil {
loggermdl.LogError(marshalError)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment