-
Notifications
You must be signed in to change notification settings - Fork 441
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tracer.StartSpanFromContext: Fix a race if opts is reused
The opts input slice comes from the caller. If it has extra capacity, the calls to append will use the slice that is passed in. If this function is called from multiple goroutines, this causes a race, where spans may not have the correct parents. Add a test to demonstrate the error. This test fails with race, and should also fail without race detection, but that will depend on the race itself.
- Loading branch information
Showing
2 changed files
with
39 additions
and
3 deletions.
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