diff --git a/CHANGELOG.md b/CHANGELOG.md index 845c6050a86..759b6e4b6d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -113,6 +113,7 @@ With this release the systemd configuration files for InfluxDB will use the syst - [#6990](https://github.com/influxdata/influxdb/issues/6990): Fix panic parsing empty key - [#7084](https://github.com/influxdata/influxdb/pull/7084): Tombstone memory improvements - [#6543](https://github.com/influxdata/influxdb/issues/6543): Fix parseFill to check for fill ident before attempting to parse an expression. +- [#7032](https://github.com/influxdata/influxdb/pull/7032): Copy tags in influx_stress to avoid a concurrent write panic on a map. ## v0.13.0 [2016-05-12] diff --git a/stress/basic.go b/stress/basic.go index 5a29c5521a1..8a6b0a5e10f 100644 --- a/stress/basic.go +++ b/stress/basic.go @@ -677,9 +677,10 @@ func (o *outputConfig) HTTPHandler(method string) func(r <-chan response, rt *Ti Precision: "ns", }) for p := range r { - o.mu.Lock() - tags := o.tags - o.mu.Unlock() + tags := make(map[string]string, len(o.tags)) + for k, v := range o.tags { + tags[k] = v + } tags["method"] = method fields := map[string]interface{}{ "response_time": float64(p.Timer.Elapsed()), @@ -688,13 +689,11 @@ func (o *outputConfig) HTTPHandler(method string) func(r <-chan response, rt *Ti bp.AddPoint(pt) if len(bp.Points())%1000 == 0 && len(bp.Points()) != 0 { c.Write(bp) - o.mu.Lock() bp, _ = client.NewBatchPoints(client.BatchPointsConfig{ Database: o.database, RetentionPolicy: o.retentionPolicy, Precision: "ns", }) - o.mu.Unlock() } } diff --git a/stress/config.go b/stress/config.go index 7fed97d432a..8b2f7a2dc5a 100644 --- a/stress/config.go +++ b/stress/config.go @@ -4,7 +4,6 @@ import ( "flag" "fmt" "strings" - "sync" "github.com/BurntSushi/toml" ) @@ -105,7 +104,6 @@ type outputConfig struct { addr string database string retentionPolicy string - mu sync.Mutex } func (t *outputConfig) SetParams(addr, db, rp string) {