Fix statsd concurrency bug (#8885)

* Fix the issue

* Remove test I was using for replication

* Accidentally removed test.

* Add lock only where it is necessary.

* eliminate unnecessary space
This commit is contained in:
David Bennett 2021-02-25 17:17:46 -05:00 committed by GitHub
parent 2cf4b751be
commit 25aa0eeb21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -712,6 +712,8 @@ func (s *Statsd) parseStatsdLine(line string) error {
// map of tags.
// Return values are (<name>, <field>, <tags>)
func (s *Statsd) parseName(bucket string) (string, string, map[string]string) {
s.Lock()
defer s.Unlock()
tags := make(map[string]string)
bucketparts := strings.Split(bucket, ",")