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

Retry ssh connection on failure #1060

Merged
merged 2 commits into from
Feb 22, 2024
Merged

Conversation

fwiesel
Copy link
Contributor

@fwiesel fwiesel commented Jan 17, 2024

Especially with lots of host going through a jump-host, there is a chance that the jump-host is overloaded.
Instead of simply failing, we can retry and back-off with some random interval to avoid the stampede

Copy link
Member

@Fizzadar Fizzadar left a comment

Choose a reason for hiding this comment

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

Big fan of this, @fwiesel, thank you for the PR! One change to move the configuration into host data and this is good to go :)

pyinfra/connectors/ssh.py Outdated Show resolved Hide resolved
Especially with lots of host going through a jump-host,
there is a chance that the jump-host is overloaded.
Instead of simply failing, we can retry and back-off
with some random interval to avoid the stampede
Copy link
Member

@Fizzadar Fizzadar left a comment

Choose a reason for hiding this comment

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

Great stuff @fwiesel - thank you for the PR!

@Fizzadar Fizzadar enabled auto-merge (rebase) February 22, 2024 09:40
@Fizzadar Fizzadar merged commit 4cdee3d into pyinfra-dev:2.x Feb 22, 2024
23 checks passed
@fwiesel fwiesel deleted the ssh_resilience branch March 4, 2024 18:54
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