-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
DataRace detected with concurrent use of client #531
Comments
https://github.com/prometheus/client_golang/blob/master/api/client.go#L121 I believe you need to place <-done one level above:
Think this bug happened because I pass in a http request scoped context, the client disconnectss, ctx.Done() can be received from so you enter that block and you attempt to Close() the body when the above go routine on line 115 is still reading the resp.Body. Related PR: #532 |
@krasi-georgiev Could you have a look? Thanks 1M. |
Little hard to say since my code makes it a tight race but I haven’t seen
it since so that’s good.
…On Mon, Jan 28, 2019 at 3:53 AM Krasi Georgiev ***@***.***> wrote:
Closed #531 <#531> via
#532 <#532>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#531 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFYalv3JGY5Hl7rPO8Av2Xp8aqxpdvkIks5vHrp_gaJpZM4aUnzY>
.
|
ok please reopen if it happens again and will revisit. Please include a full run-able client code preferably with steps to reproduce the race. |
I'm using v0.9.2 of the client. I just encountered the following data race:
A little puzzled by this since it looks like the standard golang http client is go routine safe.
Here is the relevant line in my code, tho it is pretty straight forward:
I will have many go routines call this block. Tho I assumed this was safe.
The text was updated successfully, but these errors were encountered: