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

Data race in RoundTripper #153

Closed
blixt opened this issue Jun 4, 2020 · 3 comments
Closed

Data race in RoundTripper #153

blixt opened this issue Jun 4, 2020 · 3 comments

Comments

@blixt
Copy link

blixt commented Jun 4, 2020

These lines run for every individual round trip:

if nil == original {
original = http.DefaultTransport
}

This means a data race can be triggered for two parallel requests using this RoundTripper. I don't think this is very harmful in this case since they always write the same value so even though it's indeterministic which write will be read, the value will be the same.

This still triggers Go's data race warnings so it's quite noisy and I would recommend moving these lines to the outer scope to fix the issue.

@purple4reina
Copy link
Contributor

@blixt Thanks so much for reporting this. That is indeed a problem. We'll get it fixed as soon as we can.

Take good care,
Rey

@purple4reina
Copy link
Contributor

Hey @blixt . We will be including a fix for this in our next release. Thanks again for reporting it.

@newrelic-eheinlein
Copy link
Contributor

newrelic-eheinlein commented Jun 9, 2020

Hi @blixt ! We have released version 3.6.0 today, and it includes a fix for this issue. Thanks again for reporting it! I'll close the issue now but let us know if you see any additional problems.

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

No branches or pull requests

3 participants