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 otelhttp instrumentation #5094

Closed
rosstimothy opened this issue Feb 15, 2024 · 4 comments
Closed

Data Race in otelhttp instrumentation #5094

rosstimothy opened this issue Feb 15, 2024 · 4 comments
Labels
area: instrumentation Related to an instrumentation package bug Something isn't working duplicate This issue or pull request already exists instrumentation: otelhttp response needed Waiting on user input before progress can be made

Comments

@rosstimothy
Copy link

rosstimothy commented Feb 15, 2024

Description

After upgrading to otelhttp v0.48.0 we started seeing the following race in our tests:

WARNING: DATA RACE
Write at 0x00c003b26498 by goroutine 8036:
  go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp.(*bodyWrapper).Read()
      /go/pkg/mod/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.48.0/wrap.go:40 +0x9c
  io.discard.ReadFrom()
      /opt/go/src/io/io.go:666 +0x91
  io.(*discard).ReadFrom()
      <autogenerated>:1 +0x4c
  io.copyBuffer()
      /opt/go/src/io/io.go:415 +0x22e
  io.CopyBuffer()
      /opt/go/src/io/io.go:402 +0x8f
  net/http.(*transferWriter).doBodyCopy()
      /opt/go/src/net/http/transfer.go:416 +0x144
  net/http.(*transferWriter).writeBody()
      /opt/go/src/net/http/transfer.go:376 +0x7ac
  net/http.(*Request).write()
      /opt/go/src/net/http/request.go:755 +0x1413
  net/http.(*persistConn).writeLoop()
      /opt/go/src/net/http/transport.go:2446 +0x379
  net/http.(*Transport).dialConn.gowrap3()
      /opt/go/src/net/http/transport.go:1799 +0x33

Previous read at 0x00c003b26498 by goroutine 8053:
  go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp.(*Transport).RoundTrip()
      /go/pkg/mod/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.48.0/transport.go:185 +0xfa4
  github.com/gravitational/teleport/api/observability/tracing/http.(*roundTripWrapper).RoundTrip()
      <autogenerated>:1 +0x51
  net/http.send()
      /opt/go/src/net/http/client.go:259 +0x9a6
  net/http.(*Client).send()
      /opt/go/src/net/http/client.go:180 +0x14e
  net/http.(*Client).do()
      /opt/go/src/net/http/client.go:724 +0x11c8
  net/http.(*Client).Do()
      /opt/go/src/net/http/client.go:590 +0x31d
==================

Environment

  • OS: [e.g. iOS] All
  • Architecture: [e.g. x86, i386] All
  • Go Version: [e.g. 1.15] All
  • otelhttp version: v0.48.0
@rosstimothy rosstimothy added area: instrumentation Related to an instrumentation package bug Something isn't working instrumentation: otelhttp labels Feb 15, 2024
@rosstimothy
Copy link
Author

This seems to originate from #5080

@MrAlias
Copy link
Contributor

MrAlias commented Feb 15, 2024

This seems to originate from #5080

Your description states you are testing against v0.48.0. #5080 has not been released yet, what makes you think that is causing your error?

@MrAlias
Copy link
Contributor

MrAlias commented Feb 15, 2024

Is this a duplicate of #4895?

@MrAlias MrAlias added duplicate This issue or pull request already exists response needed Waiting on user input before progress can be made labels Feb 15, 2024
@dmathieu
Copy link
Member

Closing as duplicate of #4895.

@dmathieu dmathieu closed this as not planned Won't fix, can't repro, duplicate, stale Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: instrumentation Related to an instrumentation package bug Something isn't working duplicate This issue or pull request already exists instrumentation: otelhttp response needed Waiting on user input before progress can be made
Projects
None yet
Development

No branches or pull requests

3 participants