Skip to content
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

concurrent map #981

Open
juliomartinsdev opened this issue Mar 7, 2025 · 5 comments
Open

concurrent map #981

juliomartinsdev opened this issue Mar 7, 2025 · 5 comments

Comments

@juliomartinsdev
Copy link

i notice this error using v3, is in application with many requests,
i dont know if this issue is releated

Mar 07 09:06:53.283 /workspace/vendor/resty.dev/v3/client.go:2243 +0xb2
Mar 07 09:06:53.283 resty.dev/v3.(*Client).execute(0xc0008b7b88, 0xc00263d688)
Mar 07 09:06:53.283 /workspace/vendor/resty.dev/v3/client.go:2229 +0x5d
Mar 07 09:06:53.283 resty.dev/v3.(*Client).executeRequestMiddlewares(0xc0008b7b88, 0xc00263d688)
Mar 07 09:06:53.283 /workspace/vendor/resty.dev/v3/middleware.go:36 +0x39
Mar 07 09:06:53.283 resty.dev/v3.PrepareRequestMiddleware(0xc0008b7b88, 0xc00263d688)
Mar 07 09:06:53.283 /workspace/vendor/resty.dev/v3/middleware.go:179 +0x79
Mar 07 09:06:53.283 resty.dev/v3.parseRequestHeader(0xc0008b7b88?, 0xc00263d688)
Mar 07 09:06:53.283 /layers/heroku_go/shim/go-path/pkg/mod/golang.org/[email protected]/src/internal/runtime/maps/table.go:683 +0x86
Mar 07 09:06:53.283 internal/runtime/maps.(*Iter).Next(0xc0005a9ad0?)
Mar 07 09:06:53.283 /layers/heroku_go/shim/go-path/pkg/mod/golang.org/[email protected]/src/runtime/panic.go:1053 +0x18
Mar 07 09:06:53.283 internal/runtime/maps.fatal({0x17db924?, 0x47cfcf?})
Mar 07 09:06:53.283 goroutine 2556616 [running]:
Mar 07 09:06:53.279 fatal error: concurrent map iteration and map write

can any one help here?

@BoneAsh
Copy link

BoneAsh commented Mar 10, 2025

@juliomartinsdev Could you please clarify whether you created a single *resty.Request and sent HTTP requests concurrently, or if you used a separate *resty.Request for each request?

@jeevatkm
Copy link
Member

@juliomartinsdev Do not reuse the resty.Request instance.

@juliomartinsdev
Copy link
Author

i used a single client and used a separate client.R() in each request

@jeevatkm
Copy link
Member

Thanks for getting back. Last night, I looked at the code flow based on the above trace log. I didn't get a clue, and also lock and release seems okay. Could you help me with a sample unit test case to reproduce the issue?

@jeevatkm
Copy link
Member

@juliomartinsdev ping^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants