Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Tag has concurrent access problem #1280

Open
diwufeiwen opened this issue Sep 19, 2022 · 0 comments
Open

Tag has concurrent access problem #1280

diwufeiwen opened this issue Sep 19, 2022 · 0 comments
Labels

Comments

@diwufeiwen
Copy link

Please answer these questions before submitting a bug report.

What version of OpenCensus are you using?

go.opencensus.io v0.23.0

What version of Go are you using?

go version go1.18.2

What did you do?

If possible, provide a recipe for reproducing the error.

What did you see instead?

go.opencensus.io@v0.23.0/tag/map.go#L36

// Map is a map of tags. Use New to create a context containing
// a new Map.
type Map struct {
m map[Key]tagContent
}

No locking, not thread safe.

go func() {
ctx, _ = tag.New(ctx, tag.Upsert(***)
stats.Record(ctx, ...)
}

It will panic when there is a lot of concurrency

@diwufeiwen diwufeiwen added the bug label Sep 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant