-
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
transport/http: fix metrics race condition #555
Conversation
fyi @lucix-aws @Madrigal |
gentle ping |
This looks fine - please create a changelog entry - see https://github.com/aws/aws-sdk-go-v2/blob/main/CONTRIBUTING.md#changelog-documents (it's the SDK repo, but the process is the same). |
closes #548 |
I added instructions / the make recipe to this repo as well: https://github.com/aws/smithy-go/blob/main/CONTRIBUTING.md#changelog-documents |
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.
@lucix-aws done |
41bdd6e
to
5fee405
Compare
This PR fixes a race condition reported by #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.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.