Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added working version of checking whether file is available for access #4938

Merged
merged 5 commits into from
Mar 19, 2020

Conversation

mstfbl
Copy link
Contributor

@mstfbl mstfbl commented Mar 12, 2020

Recently AutoFitRegressionTest() and AutoFitBinaryTest() have been failing occasionally on our MachineLearning-Full CI builds with the error:

System.IO.IOException : The process cannot access the file 'D:\a\1\s\bin\AnyCPU.Debug\Microsoft.ML.AutoML.Tests\netcoreapp2.1...dataset' because it is being used by another process.

Stack trace
at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle)
at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at Microsoft.ML.AutoML.TextFileSample.CreateFromFullFile(String path) in D:\a\1\s\src\Microsoft.ML.AutoML\ColumnInference\TextFileSample.cs:line 76
...

(Specific errors for AutoFitRegressionTest and AutoFitBinaryTest from CI builds)

This indicates that the .dataset file that is trying to be reached still has a lock on it, and is not yet ready for accessing. The current method of checking whether this file is ready to be accessed (checking new FileInfo(dataFile).Length > 0 is not sufficient.

The fix below remedies this by obtaining these dataset files from the local test/data path, and thereby eliminating the possibility of download locks. This fix also does the same for other datasets that are available locally that were being downloaded from a commit before, so that similar file lock issues for those datasets can be avoided as well.

@mstfbl mstfbl requested a review from a team as a code owner March 12, 2020 07:06
@mstfbl mstfbl requested a review from a team as a code owner March 13, 2020 20:58
@mstfbl
Copy link
Contributor Author

mstfbl commented Mar 19, 2020

With this build in the draft testing PR #4893, I have tested my changes with AutoFitRegressionTest() and AutoFitBinaryTest() running 100 iterations. These tests that used to hang are not not hanging anymore.

Copy link
Contributor

@frank-dong-ms-zz frank-dong-ms-zz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Copy link
Contributor

@justinormont justinormont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mstfbl mstfbl merged commit c1e422d into dotnet:master Mar 19, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Mar 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants