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

SendPostRequestAsync()'s retry logic causes ObjectDisposedException #26

Open
nshenoy opened this issue Oct 25, 2021 · 0 comments
Open

Comments

@nshenoy
Copy link

nshenoy commented Oct 25, 2021

In .NET Framework, the HttpClient automatically disposes the HttpContent after the request is made (see dotnet/runtime#14612). In the RequestManager's SendPostRequestAsync() implementation, calling the RunWithRetries() method will call subsequent retry calls to the underlying client.PostAsync() to fail as the original HttpContent gets disposed after the initial failed call. This was found because our code is exactly hitting this issue with the following message: Cannot access a disposed object. Object name: 'System.Net.Http.StringContent'. Consider restructuring this code in such a way that the HttpContent is recreated on each retry.

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

No branches or pull requests

1 participant