census-instrumentation / opencensus-go

A stats collection and distributed tracing framework
http://opencensus.io
Apache License 2.0
2.05k stars 327 forks source link

race condition inside opencensus ochttp when used inside google storage API #1274

Open Slach opened 2 years ago

Slach commented 2 years ago

Please answer these questions before submitting a bug report.

What version of OpenCensus are you using?

0.23.0

What version of Go are you using?

1.17

What did you do?

https://github.com/googleapis/google-cloud-go/issues/5664

What did you expect to see?

no race condition

What did you see instead?

race condition inside opencensus storage.NewReader() fire different http requests and should provide different Span intance

Look to https://github.com/googleapis/google-cloud-go/blob/main/storage/reader.go#L80-L96 and https://github.com/googleapis/google-cloud-go/blob/main/internal/trace/trace.go#L28-L41