-
Notifications
You must be signed in to change notification settings - Fork 53
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
Smithy-go's HTTP metrics are prone to data races #548
Comments
Just ran into this myself:
|
3 tasks
Just did a quick research, and found that this: smithy-go/transport/http/metrics.go Lines 121 to 123 in bed421c
Can be called concurrently if transport is dual-stack: Due to this: |
rjeczalik
added a commit
to rjeczalik/smithy-go
that referenced
this issue
Dec 9, 2024
This PR fixes a race condition reported by aws#548, by introducing a simple wrapper for time.Time. While by default aws-sdk-go-v2 uses NopMeterProvider, the transport/http internals are still instrumenting the http requests (the withMetrics func). Maybe there is a room for improvement, to not call httptrace.WithClientTrace when the meter is nop, however this is out of scope for this PR.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Smithy-go's HTTP metrics use
httptrace.ClientTrace
. To quote the docs:However, current implementation is not safe to call concurrently, as there are write-write data races on various methods ( for example ConnectStart ). This in turn trips data race detection.
The text was updated successfully, but these errors were encountered: