Closed edwardmeng closed 5 years ago
We should revert this commit, which can cause port exhausting problem. Add a retry logic to fix System.Net.Http.HttpRequestException ( when connection is killed or reset unexpectly ).
@shamork do you have a link to more information about this? @edwardmeng did quite a bit of testing on this and we haven't had any issues reported since we've made this change and some clients are under extreme load.
Connection: Close
means disable http-keep-alive feature
https://www.imperva.com/learn/performance/http-keep-alive/
https://serverfault.com/questions/453576/is-tcp-port-exhaustion-real
https://docs.microsoft.com/en-us/windows/client-management/troubleshoot-tcpip-port-exhaust
@shamork Are you currently running into this issue? Can you give us steps and criteria you are seeing this under? We made this change because we wanted more control over how connections were managed, All http submission happens on a background thread on a timer so it's not constant requests being made.
@shamork we are on a timer and send in batches so it's not constantly sending events. If I remember correctly, I looked at what MS was doing for App Insights client and they were doing the same thing.
We have encountered errors as following
The root cause is the http client requests will send header Connection:Keep-Alive.