New() creates a race condition if called with -race
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start at requestid.New and trace the global variable writes mentioned in the issue. Run the relevant tests with Go's -race flag, then verify that concurrent calls no longer report a race and that the request ID middleware can use distinct header keys for separate servers as described.
Written by the indexing model from the issue text.
Description
If executing multiple calls to requestid.New (in tests for example) the writing to a global var produces a race condition, this can easily be avoided with a simple lock supplementing the global var.
This kinda raised another question for me, what if I want to use the request id middleware for multiple servers in a single app with different header keys?
I honestly think it would best to save the header key in the gin context for that request and later if fetched check in the context what the key is.
- Dominant language
- Go
- Stars
- 262
- Forks
- 20
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 2
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Similar issues
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
blinklabs-io/bursa#904 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
yanet-platform/ipfw-go#129 ·
-
bug confmap/provider/googlesecretmanagerprovider needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
open-telemetry/opentelemetry-collector-contrib#51273 · 2 comments ·
-
bug: AI Gateway client filter lists "Unknown" twice when NULL and literal Unknown clients coexist Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100