The jdk 11's HttpClient keeps a SelectorManager thread alive for the lifetime of the HttpClient reference. It was observed that we create hundreds or even thousands of CloudControllerClients, each of which has a LogCacheClient, each with an HttpClient. This resulted in over 2.1K SelectorManager threads and was causing crashes.
This commit changes the lifecycle of the HttpClient used for application logs to be only for the scope of the method call.
The jdk 11's HttpClient keeps a SelectorManager thread alive for the lifetime of the HttpClient reference. It was observed that we create hundreds or even thousands of CloudControllerClients, each of which has a LogCacheClient, each with an HttpClient. This resulted in over 2.1K SelectorManager threads and was causing crashes.
This commit changes the lifecycle of the HttpClient used for application logs to be only for the scope of the method call.