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

Attempt to download tentacles multiple times #703

Merged
merged 2 commits into from
Dec 1, 2023

Conversation

LukeButters
Copy link
Contributor

Background

We are seeing time outs when downloading older tentacle versions, where the timeout is set to 150s.

This PR attempts to help with that by:

  • Reducing the timoeut to 20s, since the timeout appears to apply to each read/write rather than the operation as a whole.
  • Attempt 5 times (with a simple for loop since the problem we have is a timout of 20s to read any bytes so we probably don't have a reason to get fancy).

How to review this PR

Quality ✔️

Pre-requisites

  • I have read How we use GitHub Issues for help deciding when and where it's appropriate to make an issue.
  • I have considered informing or consulting the right people, according to the ownership map.
  • I have considered appropriate testing for my change.

@LukeButters LukeButters requested a review from a team as a code owner November 29, 2023 04:49
}
}
}
catch (Exception e)
{
throw new Exception($"Failure to download: {downloadUrl}. After {totalTime.Elapsed.TotalSeconds} seconds we only downloaded, {totalRead}", e);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These logs don't make it to the build server :(, so instead make the exception contain information already in the logs.

@LukeButters LukeButters force-pushed the sast/improve-tentacle-compat-downloading branch from 5778485 to ad95f8f Compare November 30, 2023 23:44
@@ -17,56 +18,99 @@ public class OctopusPackageDownloader
{
public static async Task DownloadPackage(string downloadUrl, string filePath, ILogger logger)
{
var exceptions = new List<Exception>();
for (int i = 0; i < 5; i++)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Simple for loop is simple

@LukeButters LukeButters enabled auto-merge (squash) November 30, 2023 23:46
@LukeButters LukeButters merged commit f7f39fa into main Dec 1, 2023
48 checks passed
@LukeButters LukeButters deleted the sast/improve-tentacle-compat-downloading branch December 1, 2023 02:07
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