Singleton HttpClient? Beware of this serious behaviour and how to fix it
It was 100% believed that HttpClient was safe, even when used as Singleton, and yet there was an underlying, and very serious issue: DNS changes were NOT honoured and HttpClient (through HttpClientHandler) hogged the connections until socket was closer. Indefinitely.
According to Byte Rot “this has been going on for more than 2 years without being reported… makes me wonder what kind of applications we build with .NET?”
See how our very own Andy Jutton came up with the obscure, but successful solution to this serious problem here…