-
Notifications
You must be signed in to change notification settings - Fork 415
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
contrib: fix span start option races #2418
Merged
Merged
Changes from 3 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
8f24d7b
contrib/*: fix multiple spanOpts potential append() data race
eliottness 2ef8ddc
fix start span option races
5e8ff05
fix echo span tag ordering
1b1eba1
fix chi options
260f6d8
refactor to make copies more explicit and add helper method
katiehockman 9778ffe
move OptionsCopy to a new contrib-wide internal package
katiehockman f24ebd3
add a unit test for OptionsCopy
katiehockman 694bf1f
rename options.OptionsCopy to options.Copy to avoid repetitive naming
katiehockman 4fe86a7
fix additional races in other packages
katiehockman 346aa7c
gofmt on roundtripper.go
katiehockman 64fd168
clarify godoc for options.Copy
katiehockman 5bc5a22
small cleanups to avoid unnecessary changes
katiehockman bcb9b19
revert changes to fiber.go and roundtripper.go
katiehockman ddf67cd
avoid opts change side effects in goji.go and httptreemux.go
katiehockman 7b0ae77
fix httptreemux.go based on https://go.dev/play/p/bcPus1ofHPd
katiehockman 0b9c2db
remove all changes that aren't strictly necessary to fix the race
katiehockman bb7a30d
remove unecessary changes in httptreemux.go
katiehockman 4b0e472
fix TraceAndServe in contrib/net/http
katiehockman 492981b
Merge branch 'main' into eliott.bouhana/fix-span-opts-race
katiehockman 01dd225
allocate enough space in the destination slice to make the fully copy
katiehockman 1ab2a4c
Merge branch 'eliott.bouhana/fix-span-opts-race' of github.com:DataDo…
katiehockman 3c089f2
remove unnecessary changes in goji.go
katiehockman d9b7e10
Merge branch 'main' into eliott.bouhana/fix-span-opts-race
katiehockman File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most likely actually not an issue here, but I'd want to point out that this change affectes the order of the options, which could affect the end result...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is why a "builder" would be preferable to enforce this too, whereas every contrib is doing its own thing at the moment, and some of them have ordering tests while others don't.
This is a known limitation of the current design that we discussed in the past here #1352
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was difficult to use a builder here, since the builder just ended up being shared as well, which led to the same problem. At least for now, I made a helper method to make those copies more explicit, so I'm hoping that'll help a bit with readability. It doesn't fully prevent this in the future, but it does make it more explicit.