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

Implement retry logic with exponential backoff for connection errors #20

Closed
wants to merge 1 commit into from

Conversation

blizard863
Copy link
Collaborator

@blizard863 blizard863 commented Jun 13, 2024

Related to #19

This pull request introduces retry logic with exponential backoff for connection errors in both gssh_runner.go and nssh_runner.go files, enhancing the robustness of SSH tunnel connections. Additionally, it ensures proper handling of WaitGroup upon successful retries, maintaining the integrity of the running processes.

  • Implements retry logic: Adds a retry mechanism for SSH tunnel connections in case of failures. This is done through a separate goroutine that attempts to reconnect with an exponential backoff strategy, starting from 1 second and doubling each time until it reaches a 30-second interval.
  • Handles WaitGroup upon successful retry: Ensures that the WaitGroup is correctly managed upon a successful retry, preventing premature exit of the Run function and maintaining the stability of the application.
  • Enhances error logging: Improves error logging for both initial connection failures and subsequent retry attempts, providing better visibility into the connection process and potential issues.

For more details, open the Copilot Workspace session.

@blizard863 blizard863 closed this Jun 13, 2024
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.

1 participant