Repository navigation
Corrects memozation of HttpHandlers. - #3881
Conversation
|
Wow. Cool stuff. |
|
I'd suggest using Question is why the url string actually differs each time, maybe we should always use the raw feed URL here somehow and propagate it through? |
|
You can also release this and see if someone complains... |
Using System.Uri might not be the worst idea. I chose to not do it, as it would involve creating an Uri instance every time. But this is not the hottest of paths. I can try and do some measurements, if you want me to. The issue with multiple credentials does not arise, as this will create a different key for the memoization anyway. |
|
Ah you are right as auth is part of the key as well. Overlooked that, nice. |
|
Noticing a problem with this version (5.248.1) on mono 5.4. The restoration process freezes with output like The problem goes away when pinning Paket to a previous version or using mono 6. |
|
Oh noes :( Maybe mono's implementation of the HttpHandlers are somehow different? Can we know in the code, which mono version we are running on and the fall back to the old implementation? |
|
@blair55 Can you please show us the output of paket with the |
|
Huh – It got some response from the API in the first place, but then just … failed?! |
This is in response to #3850 .
One
HttpHandlerinstance has a connection pool, that is reused for different requests.Currently, part of the key for the Handler memoization is the request's URL. But the URL is different for basically any request. So in this PR I am truncating the URL for the memoization key to just the host part.
I could not test it, but I assume, that things like the NTLM auth do not break by this. The docs give an example where they also only provide the host part of an URL to the
NetworkCredentials.In my tests for a paket.depedencies file which results in 75 unique packages, not downloaded, only resolved, all from NuGet.org, the current implementation opened 78 TCP connection. The implementation of this PR for the same setup only four. This is the expected amount, as per the supplied configs in https://github.com/fsprojects/Paket/blob/master/src/Paket.Core/Common/NetUtils.fs#L360