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

Try to defend against interference by retrying some io operations. #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hatton
Copy link
Member

@hatton hatton commented Nov 24, 2016

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 Reviewable

Copy link

@JohnThomson JohnThomson left a 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(() =>

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?

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(() =>

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),

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants