Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy tags in influx_stress to avoid a concurrent write panic on a map #7032

Merged
merged 1 commit into from
Aug 1, 2016

Conversation

jsternberg
Copy link
Contributor

No description provided.

@jsternberg jsternberg force-pushed the js-fix-influx-stress-concurrent-write-panic branch 2 times, most recently from 746efb8 to be2ade8 Compare July 19, 2016 16:19
@@ -678,8 +678,11 @@ func (o *outputConfig) HTTPHandler(method string) func(r <-chan response, rt *Ti
Precision: "ns",
})
for p := range r {
tags := make(map[string]string)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make(map[string]string, len(o.tags)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason why I didn't do that is because then we would likely want to take a lock on the tags so that len(o.tags) doesn't have a race condition. I didn't want to take a lock while allocating memory when I don't think it will have a substantial difference in performance as the size of the map is so small.

@jsternberg jsternberg force-pushed the js-fix-influx-stress-concurrent-write-panic branch from be2ade8 to fc326b1 Compare July 21, 2016 18:18
@jwilder
Copy link
Contributor

jwilder commented Jul 21, 2016

stress/basic.go:681: o.mu.RLock undefined (type sync.Mutex has no field or method RLock)
stress/basic.go:686: o.mu.RUnlock undefined (type sync.Mutex has no field or method RUnlock)

@jsternberg jsternberg force-pushed the js-fix-influx-stress-concurrent-write-panic branch 2 times, most recently from cda0ef5 to b1fdf27 Compare July 21, 2016 20:53
@jwilder
Copy link
Contributor

jwilder commented Jul 21, 2016

Not sure why this failed on AppVeyor. 👍 on green.

--- FAIL: TestService_IgnoreNonMatch (0.05s)
    service_test.go:83: expected urls

@jsternberg jsternberg force-pushed the js-fix-influx-stress-concurrent-write-panic branch 2 times, most recently from 472ab3f to 94b6885 Compare August 1, 2016 18:11
Removing lock from the same object as that object never does anything
except for having attributes read.
@jsternberg jsternberg force-pushed the js-fix-influx-stress-concurrent-write-panic branch from 94b6885 to ccd1bd9 Compare August 1, 2016 18:18
@jsternberg jsternberg merged commit c65693a into master Aug 1, 2016
@jsternberg jsternberg deleted the js-fix-influx-stress-concurrent-write-panic branch August 1, 2016 18:40
@timhallinflux timhallinflux added this to the 1.0.0 milestone Dec 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants