Uh oh!
There was an error while loading. Please reload this page.
Fixed and Added unit tests for EnsureResourceAsync hanging issue - #4943
Conversation
Uh oh!
There was an error while loading. Please reload this page.
This reverts commit 63b3f33.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
mstfbl
commented
Mar 24, 2020
I have added a check to ensure only resources downloaded from the "aka.ms" host can use EnsureResourceAsync(). I have also edited the unit test for EnsureResourceAsync() to reflect this. |
Uh oh!
There was an error while loading. Please reload this page.
Fixed EnsureResourceAsync by removing the helper function ResourceManagerUtils.CheckValidDownload and by using WebClientResponseUri (an extension of WebClient). Also added unit test for EnsureResourceAsync.
ResourceManagerUtils.EnsureResourceAsync(...) appends the relative URL of a resource to the $MlNetResourcesUrl environment variable (equal to "https://aka.ms/mlnet-resources/" by default).
machinelearning/src/Microsoft.ML.Core/Utilities/ResourceManagerUtils.cs
Line 34 in cdb1e4b
For example, this occurs in the unit test WordEmbeddingsTest.TestWordEmbeddings(), where
sentimend.emdis downloaded from https://aka.ms/mlnet-resources/Text/Sswe/sentiment.emd .There is a possibility of this combined URL not correctly pointing to a resource, which is why this CheckValidDownload function exists:
machinelearning/src/Microsoft.ML.Core/Utilities/ResourceManagerUtils.cs
Lines 168 to 184 in cdb1e4b
This function was not correctly warning that the HTML of www.microsoft.com was downloaded (instead of an intended data file), as the size of microsoft.com is bigger than 4 kilobytes, and the site should have the sub-strings <head and <body (not and ).