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 retry for 0 StatusCode #78

Merged
merged 3 commits into from
Aug 30, 2021
Merged

Conversation

saswatamcode
Copy link
Collaborator

This PR adds link retries for 0 status code. As seen in runs in Thanos (for example here), mdox errors out if there is status code 0. It isn't defined but generally occurs when the request is aborted for some reason or the host doesn't exist.
Retrying once might help mitigate this and reduce the annoyance.

@saswatamcode saswatamcode requested a review from bwplotka August 22, 2021 19:40
@saswatamcode saswatamcode self-assigned this Aug 22, 2021
@@ -284,7 +284,7 @@ func NewValidator(ctx context.Context, logger log.Logger, linksValidateConfig []
break
}
v.remoteLinks[response.Ctx.Get(originalURLKey)] = errors.Wrapf(err, "%q rate limited even after retry; status code %v", response.Request.URL.String(), response.StatusCode)
case http.StatusMovedPermanently, http.StatusTemporaryRedirect, http.StatusServiceUnavailable:
case http.StatusMovedPermanently, http.StatusTemporaryRedirect, http.StatusServiceUnavailable, 0:
Copy link
Owner

Choose a reason for hiding this comment

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

// Let's add comment that 0 means error on call side.

Signed-off-by: Saswata Mukherjee <[email protected]>
Signed-off-by: Saswata Mukherjee <[email protected]>
Signed-off-by: Saswata Mukherjee <[email protected]>
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