Closed davidfowl closed 5 years ago
Why bother? The HttpContext and the RequestServicesFeature have almost exactly the same lifetime.
I was looking at dumps and noticed this. What's interesting is that when looking at the dump (when using kestrel), it is stored per connection. Even though it does get cleared out between, it looks pretty weird. It also doesn't hurt, but you're right we do have a bunch of features other features that are in the same boat.
Are you going to clear the _scopeFactory while you're at it?
Yes, I should
Kestrel keeps a field for the IServiceProvidersFeature per http/1 connection, but it clears it at the start/end of every request.
Yes thats what I said 😄