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

Fix data race accessing Request.URL #1472

Merged
merged 1 commit into from
Jun 21, 2023
Merged

Conversation

axw
Copy link
Member

@axw axw commented Jun 21, 2023

If an HTTP client is instrumented with apmhttp, then the http.Request.URL is recorded for including in span context. The caller of the HTTP client request may mutate the URL after the response is ready, so we must clone the URL while recording it to prevent data races.

If an HTTP client is instrumented with apmhttp,
then the http.Request.URL is recorded for including
in span context. The caller of the HTTP client request
may mutate the URL after the response is ready, so we
must clone the URL while recording it to prevent data
races.
@axw axw requested a review from a team June 21, 2023 06:37
@axw axw enabled auto-merge (squash) June 21, 2023 06:38
@axw axw merged commit a402c4b into elastic:main Jun 21, 2023
@axw axw deleted the http-request-url-race branch June 21, 2023 06:51
axw added a commit that referenced this pull request Jun 22, 2023
* module/apmotel: update to stable metrics API (#1448)

* module/apmotel: update to stable metrics API

* module/apmotel: go mod download

* Allow retrieving span created in agent from otel, and store agent span in context when creating it with otel (#1450)

* store the agent transaction and span into the context

* add wrapper so we can retrieve agent span from otel

* fix precheck

* Require Go 1.19+ (#1453)

* Require Go 1.19

Update docs to drop the "best effort" support for
unsupported Go versions, and only test with the
two most recent Go releases. Also, simplify the
"check-modules" and "update-modules" make targets.

* Remove extraneous "go:build" tags

* README: update supported Go versions (#1463)

* Update https://github.com/stretchr/testify v1.8.4 (#1464)

* [doc] Align agents logs documentation (#1465)

* align logs docs

* fix typo

* add missing reference

* build(deps): bump github.com/gin-gonic/gin in /module/apmgin (#1451)

Bumps [github.com/gin-gonic/gin](https://github.com/gin-gonic/gin) from 1.7.7 to 1.9.1.
- [Release notes](https://github.com/gin-gonic/gin/releases)
- [Changelog](https://github.com/gin-gonic/gin/blob/master/CHANGELOG.md)
- [Commits](gin-gonic/gin@v1.7.7...v1.9.1)

---
updated-dependencies:
- dependency-name: github.com/gin-gonic/gin
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update golang.org/x/... to latest (#1466)

* Update golang.org/x/sys to latest

* Update golang.org/x/*

* Update go-fastjson

* build(deps): bump mellium.im/sasl in /module/apmgopgv10 (#1467)

Bumps mellium.im/sasl from 0.2.1 to 0.3.1.

---
updated-dependencies:
- dependency-name: mellium.im/sasl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump github.com/prometheus/client_golang (#1468)

Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.7.0 to 1.11.1.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](prometheus/client_golang@v1.7.0...v1.11.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump mellium.im/sasl from 0.2.1 to 0.3.1 in /module/apmgopg (#1373)

Bumps mellium.im/sasl from 0.2.1 to 0.3.1.

---
updated-dependencies:
- dependency-name: mellium.im/sasl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* ci: use latest Go release for microbenchmarks (#1469)

* Fix data race accessing Request.URL (#1472)

If an HTTP client is instrumented with apmhttp,
then the http.Request.URL is recorded for including
in span context. The caller of the HTTP client request
may mutate the URL after the response is ready, so we
must clone the URL while recording it to prevent data
races.

* Prepare v2.4.3 (#1473)

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Damien Mathieu <[email protected]>
Co-authored-by: Silvia Mitter <[email protected]>
Co-authored-by: SylvainJuge <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants