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

[Bug]: go-resty has a use after free causing request body concatenation #1111

Closed
lattwood opened this issue Nov 2, 2023 · 1 comment
Closed
Labels
bug issues that report a bug

Comments

@lattwood
Copy link

lattwood commented Nov 2, 2023

Expected Behavior

Request bodies shouldn't be concatenated with bodies from other requests.

Actual Behavior

They were.

Steps to Reproduce

Has been provided through other channels.

Free text since the above categories are stifling

go-resty handles retries internally in a not so great way. This bug only happens when there's a request retry, which triggers the double sync.Pool Put of the same struct, causing the race condition resulting in HTTP 400 invalid json errors.

I guess this is actually a bug in your Golang client since that uses go-resty.

I would strongly suggest replacing go-resty with the solution DigitalOcean went with- https://github.com/digitalocean/godo#automatic-retries-and-exponential-backoff

PR opened upstream: go-resty/resty#745

@lattwood lattwood added the bug issues that report a bug label Nov 2, 2023
@lattwood lattwood changed the title [Bug]: go-resty has a double free causing request body concatenation [Bug]: go-resty has a use after free causing request body concatenation Nov 3, 2023
@zliang-akamai
Copy link
Contributor

Thanks for the report! Downgraded to v2.9.1 for now and waiting for resty developers to fix it. Considering this as solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issues that report a bug
Projects
None yet
Development

No branches or pull requests

2 participants