-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Try to defend against interference by retrying some io operations. #24
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks basically good...just a few things to think about.
@@ -160,34 +160,42 @@ public string CreateReleasePackage(string outputFile, string packagesRootDir = n | |||
// We must do this, or PathTooLongException may be thrown for some unicode entry names. | |||
public static void ExtractZipDecoded(string zipFilePath, string outFolder, string directoryFilter = null) | |||
{ | |||
var zf = new ZipFile(zipFilePath); | |||
Utility.Retry(() => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will probably work, but it means redoing the whole (100m or so?) extract on every failure. I would have been more inclined to put the Retry calls just (or also) around the directory creation and the individual file extracts.
Will the file extract operations succeed if (on a retry) the file already exists?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another thought: do we know whether failure to extract/create directory will throw IOException or something else (a permission exception? a Zip utility exception?). May need to pass more exception types to Retry.
@@ -331,15 +331,17 @@ Task<string> installPackageToAppDir(UpdateInfo updateInfo, ReleaseEntry release) | |||
|
|||
toMove.ForEach(ld => { | |||
ld.GetDirectories() | |||
.ForEachAsync(subdir => subdir.MoveTo(subdir.FullName.Replace(ld.FullName, target.FullName))) | |||
.ForEachAsync(subdir => | |||
Utility.Retry(() => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, anything we've seen to suggest that other exception types should be retried?
@@ -62,7 +62,7 @@ public ApplyReleasesImpl(string rootAppDirectory) | |||
return getDirectoryForRelease(updateInfo.CurrentlyInstalledVersion.Version).FullName; | |||
} | |||
|
|||
var ret = await this.ErrorIfThrows(() => installPackageToAppDir(updateInfo, release), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All these trailing-space deletions are distracting, especially in a repo that's mainly someone else's.
Since we have not been able to reproduce this problem (but one site had 5 failures in a row), I don't know if this will help or not. Sigh.
This change is