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

net: dial retries #981

Merged
merged 5 commits into from
Dec 6, 2024
Merged

net: dial retries #981

merged 5 commits into from
Dec 6, 2024

Conversation

mmatczuk
Copy link
Contributor

@mmatczuk mmatczuk commented Dec 6, 2024

Fixes #706

@mmatczuk mmatczuk requested a review from Choraden as a code owner December 6, 2024 13:06
.golangci.yml Show resolved Hide resolved
net.go Show resolved Hide resolved
net.go Outdated
Comment on lines 72 to 84
Retry: 3,
RetryBackoff: 1 * time.Second,
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This does not belong here.

Add retry config and implementation in Dialer.
Also, add test harness for dialing errors.
net.go:186:2: for loop can be changed to use an integer range (Go 1.22+) (intrange)
        for i := 0; i < attempts; i++ {
    --http-dial-attempts <int> (default 3) (env FORWARDER_HTTP_DIAL_ATTEMPTS)
        The number of attempts to dial the network address.

    --http-dial-backoff <duration> (default 1s) (env FORWARDER_HTTP_DIAL_BACKOFF)
        The amount of time to wait between dial attempts.
@mmatczuk mmatczuk merged commit 4440c9e into main Dec 6, 2024
6 checks passed
@mmatczuk mmatczuk deleted the mmt/dial_retry branch December 6, 2024 15:21
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.

net: dial retries
2 participants