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

Add HTTP timeout and retry on TCP connection reset #52

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

NamelessOne91
Copy link
Contributor

@NamelessOne91 NamelessOne91 commented Oct 18, 2024

This PRs tries to address 2 issues

  1. We use Go's default value for the Timeout field in our HTTP clients, which is 0. That value actually means that no timeout at all is applied, potentially leading to HTTP calls hanging indefinitely.
    An optional field is added to the .yml configuration, so that users can individually define a custom timeout (in minutes).
    If no timeout value is provided, the default is to apply a 60 min timeout to each HTTP call (this includes also the time it takes to read the response body).
    Users can still define a timeout of 0 if they intend to have no timeout on their calls.

  2. Currently, we repeat the sync for a repository up to 20 times when there are errors downloading packages.
    The event of a TCP connection being reset was not handled in this loop, leading to an immediate failure for the given repository.

The configuration parsing function and Config structs are also moved to the root command file.

@NamelessOne91 NamelessOne91 self-assigned this Oct 18, 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