You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
while browsing through the source code I've noticed, that the httpclient is being instantiated in the constructor of the MandrillApi, this could be causing several issues, like socket exhaustion and outdated dns configuration.
From MSDN Documentation:
While this class implements IDisposable, declaring and instantiating it within a using statement is not preferred because when the HttpClient object gets disposed of, the underlying socket is not immediately released, which can lead to a socket exhaustion problem. For more information about this issue, see the blog post You're using HttpClient wrong and it's destabilizing your software.
The text was updated successfully, but these errors were encountered:
codingmoh
changed the title
Bug: HttpClient Usage and usage without retry policy
Bug: The way httpclient is being used could cause several issues
Mar 22, 2020
codingmoh
changed the title
Bug: The way httpclient is being used could cause several issues
Bug: The way httpclient is being used, could cause several issues
Mar 22, 2020
codingmoh
changed the title
Bug: The way httpclient is being used, could cause several issues
Bug: The way httpclient is being used in the MandrillApi could lead to several issues
Mar 22, 2020
Hello there,
while browsing through the source code I've noticed, that the httpclient is being instantiated in the constructor of the MandrillApi, this could be causing several issues, like socket exhaustion and outdated dns configuration.
From MSDN Documentation:
See: https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests#issues-with-the-original-httpclient-class-available-in-net-core
And here: https://aspnetmonsters.com/2016/08/2016-08-27-httpclientwrong/
Another potential issue I've discovered is that the HttpClient is being used without a retry policy. I/O Operations and request (esp. HttpRequests) could always fail due to various reasons. This could be easily solved by using the polly library:
https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/implement-http-call-retries-exponential-backoff-polly
Suggestion for fixing this:
The text was updated successfully, but these errors were encountered: