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
It which needlessly recreates/duplicates the underlying tcp connection pools for each instance of SendGridClient created. More troublesome, it leaves the underlying pools of tcp connections in a wait status for several minutes after each instance of SendGridClient is disposed, using up limited network ports which can often cause issues on cloud platforms such as azure which are easily exhausted.
HttpClient instances should be static, and the underlying threadpool connections should be expired periodically to account for DNS changes for the remote host.
See #839@akunzai implemented this over half a year ago and it's awaiting response from one of the repository owners.
I agree this should be a priority change, the client currently doesn't play nice with a myriad of cloud technologies and paradigms and we should be making rapid steps towards improving the situation.
Currently HttpClient as used in https://github.com/sendgrid/sendgrid-csharp/blob/master/src/SendGrid/SendGridClient.cs#L32 creates multiple instances of HttpClient which is improper use of the class.
It which needlessly recreates/duplicates the underlying tcp connection pools for each instance of SendGridClient created. More troublesome, it leaves the underlying pools of tcp connections in a wait status for several minutes after each instance of SendGridClient is disposed, using up limited network ports which can often cause issues on cloud platforms such as azure which are easily exhausted.
HttpClient instances should be static, and the underlying threadpool connections should be expired periodically to account for DNS changes for the remote host.
See https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient?view=netframework-4.8
The text was updated successfully, but these errors were encountered: