Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
MKCLOS
Core Development Platform
corepkgv2
Commits
b74d8d37
Commit
b74d8d37
authored
4 years ago
by
Ajit Jagtap
Browse files
Options
Downloads
Plain Diff
Merge branch 'ab_Fix_StatemdlBreaking' into 'devbranch'
Fix: Panic due to concurrent map r/w See merge request
!213
parents
24e11692
8f90663b
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!214
Release v1.1.1
,
!213
Fix: Panic due to concurrent map r/w
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
statemdl/state.go
+6
-0
statemdl/state.go
with
6 additions
and
0 deletions
statemdl/state.go
+
6
−
0
View file @
b74d8d37
...
@@ -392,6 +392,12 @@ func collectStatistics() {
...
@@ -392,6 +392,12 @@ func collectStatistics() {
clientResponseData
.
ServicesState
=
stateCache
clientResponseData
.
ServicesState
=
stateCache
clientResponseData
.
QueryState
=
queryCache
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
)
ba
,
marshalError
:=
ffjson
.
Marshal
(
clientResponseData
)
if
errormdl
.
CheckErr
(
marshalError
)
!=
nil
{
if
errormdl
.
CheckErr
(
marshalError
)
!=
nil
{
loggermdl
.
LogError
(
marshalError
)
loggermdl
.
LogError
(
marshalError
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets