-
Notifications
You must be signed in to change notification settings - Fork 677
Open
Labels
area: instrumentationRelated to an instrumentation packageRelated to an instrumentation packagebugSomething isn't workingSomething isn't workinginstrumentation: otelhttp
Description
Description
Using atomic.Int64 will fix the data race but the logical race will still be there i.e. the number of read bytes will be incorrect because the reader goroutine might have not finished reading. My understanding is the value can only be read after Close() has been called on the body. And in that case a plain int64 should be fine.
I think this fix may lead to incorrect metric reported, see my comment here #4895 (comment). This can be checked by having a reader for the body that is slow+a big body and a server that starts responding without consuming all of the incoming request's body.
Environment
- OS: [e.g. iOS]
- Architecture: [e.g. x86, i386]
- Go Version: [e.g. 1.15]
otelhttp
version: [e.g. v0.14.0, 3c7face]
Steps To Reproduce
- Using this code ...
- Run ...
- See error ...
Expected behavior
Number of reported bytes read always matches the actual number of bytes read.
Metadata
Metadata
Assignees
Labels
area: instrumentationRelated to an instrumentation packageRelated to an instrumentation packagebugSomething isn't workingSomething isn't workinginstrumentation: otelhttp
Type
Projects
Status
Needs triage