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

(MODULES-10909) Commands retry on network connectivity failures #536

Merged
merged 1 commit into from
Feb 5, 2021
Merged

(MODULES-10909) Commands retry on network connectivity failures #536

merged 1 commit into from
Feb 5, 2021

Conversation

adrianiurca
Copy link
Contributor

@adrianiurca adrianiurca commented Jan 27, 2021

Before this commit, the install tasks (install_shell.sh and install_powershell.ps1) exited at the first network connectivity failure. This change adds a retry mechanism to the wget, curl, fetch, perl, yum, zypper, apt-get (Linux) and System.Net.Webclient.DownloadFile (Windows) commands which waits one second between attempts. The number of attempts is 5 by default but can be configured via the new retry setting.

@adrianiurca adrianiurca requested a review from a team as a code owner January 27, 2021 12:20
@adrianiurca adrianiurca changed the title [MODULES-10909] - Add retry parameter to wget/curl/fetch commands (MODULES-10909) - Add retry parameter to wget/curl/fetch commands Jan 29, 2021
@adrianiurca adrianiurca changed the title (MODULES-10909) - Add retry parameter to wget/curl/fetch commands (MODULES-10909) - Add retry parameter and mechanism to wget/curl/fetch commands Jan 29, 2021
@adrianiurca adrianiurca changed the title (MODULES-10909) - Add retry parameter and mechanism to wget/curl/fetch commands (MODULES-10909) Add retry mechanism to wget/curl/fetch commands Jan 29, 2021
@luchihoratiu luchihoratiu self-requested a review January 29, 2021 13:32
@lucywyman
Copy link
Contributor

The ticket specifically calls out Windows hiccups, but this doesn't seem to modify the PowerShell task as well? It seems like it'd be useful, for us and users, to add it there too.

tasks/install_powershell.ps1 Outdated Show resolved Hide resolved
tasks/install_powershell.ps1 Outdated Show resolved Hide resolved
tasks/install_powershell.json Outdated Show resolved Hide resolved
tasks/install_shell.json Outdated Show resolved Hide resolved
tasks/install_shell.sh Show resolved Hide resolved
tasks/install_shell.sh Outdated Show resolved Hide resolved
tasks/install_shell.sh Outdated Show resolved Hide resolved
@luchihoratiu
Copy link
Contributor

luchihoratiu commented Feb 4, 2021

Added a commit with some changes after discussing with @adrianiurca. Manually tested all the changes using Bolt on Microsoft Windows 2019, SLES 11, SLES 15 and Ubuntu 18.04 and seems to be working as expected.

Copy link
Contributor

@lucywyman lucywyman left a comment

Choose a reason for hiding this comment

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

Tests:

  • Accepts retry of 0 and does not retry
  • Accepts negative number and does not retry
  • Retries when running the PowerShell task
  • Retries when running the nix task

tasks/install_shell.sh Outdated Show resolved Hide resolved
Before this commit, the install tasks (`install_shell.sh` and
`install_powershell.ps1`) exited at the first network connectivity
failure. This change adds a retry mechanism to the `wget`, `curl`,
`fetch`, `perl`, `yum`, `zypper`, `apt-get` (Linux) and
`System.Net.Webclient.DownloadFile` (Windows) commands which waits one
second between attempts. The number of attempts is `5` by default but
can be configured via the new retry setting.
@luchihoratiu luchihoratiu changed the title (MODULES-10909) Add retry mechanism to wget/curl/fetch commands (MODULES-10909) Commands retry on network connectivity failures Feb 5, 2021
@luchihoratiu
Copy link
Contributor

Squashed the commits and updated the commit message/description.

@GabrielNagy GabrielNagy merged commit 655b913 into puppetlabs:main Feb 5, 2021
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.

4 participants