出现fatal error: concurrent map read and map write。
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 4.9k
- Forks
- 409
- Avg merge
- 6h 47m
- Merged PRs (30d)
- 7
Description
goroutine 5677 [running]:
github.com/imroc/req/v3.parseRequestHeader(0xc000626dc0, 0xc000a44000)
/root/go/pkg/mod/github.com/imroc/req/v3@v3.48.0/middleware.go:537 +0x391
github.com/imroc/req/v3.(*Request).do(0xc000a44000)
/root/go/pkg/mod/github.com/imroc/req/v3@v3.48.0/request.go:660 +0xac7
github.com/imroc/req/v3.(*Request).Do(0xc000a44000, {0x0, 0x0, 0xc000e067b0?})
/root/go/pkg/mod/github.com/imroc/req/v3@v3.48.0/request.go:636 +0x38f
github.com/imroc/req/v3.(*Request).Send(0xc000a44000, {0xec2aad, 0x3}, {0xc000042540, 0x3c})
/root/go/pkg/mod/github.com/imroc/req/v3@v3.48.0/request.go:726 +0xfb
github.com/imroc/req/v3.(*Request).Get(...)
/root/go/pkg/mod/github.com/imroc/req/v3@v3.48.0/request.go:745
main.(*config).request.func4({0xc000042540, 0x3c}, 0x3, 0xc000590200)
/opt/go-project/net_check/test2.go:529 +0x185
created by main.(*config).request in goroutine 5653
/opt/go-project/net_check/test2.go:527 +0x1265
请问这个问题要如何处理?
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.
Research direction
Start at middleware.go:537, using the reported concurrent goroutine path as the entry point, and inspect how request headers are accessed. Reproduce the failure with the concurrent request pattern shown at test2.go:527-529; completion should include a project test or documented handling that prevents the reported concurrent-map panic.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100