Getting a endless HttpMessageHandler cleanup cycle - More Guidance Please #42761
Unanswered
SOHODeveloper
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I know this issue has been visited at least twice once in the now archived HttpCLientFactory repo # 165 and again in
#3470
I have 3 applications that use HttpCientFactory to create HttpClients to send requests. All three of them exhibit the same buildup of MessageHandlers. After a few days of running there are hundreds of them in the list. I have forced a GC as suggested, but the handlers remained.
I an currently running with 5.0 RC1 This issue has been around for most if not all of the 5.0 previews, so it is not an RC1 specific issue. I am assume it is something I have done wrong, but I need guidance to determine what is keeping a reference to what.
In #3470, the question came up as to path to root. My path to root is different than what was posted there.
I have a memory dump in which the logs indicated that there were 2 message handlers to be freed.
Looking in my dump, I have the following items with the MessageHandler in their name and a quantity of 2.
List<Action<Microsoft.Extensions.Http.HttpMessageHandlerBuilder>>
Action<Microsoft.Extensions.Http.HttpMessageHandlerBuilder>
Microsoft.Extensions.Http.PolicyHttpMessageHandler
Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler
Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler
Microsoft.Extensions.Http.LifetimeTrackingHttpMessageHandler
I do not know how to understand which of these types, the trace is discussing, but given that the last person was asked about Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler and Microsoft.Extensions.Http.LifetimeTrackingHttpMessageHandler I will supply the information about them.
Beta Was this translation helpful? Give feedback.
All reactions