Skip to content

Add retry for 0 StatusCode#78

Merged
bwplotka merged 3 commits intobwplotka:mainfrom
saswatamcode:handle-zero
Aug 30, 2021
Merged

Add retry for 0 StatusCode#78
bwplotka merged 3 commits intobwplotka:mainfrom
saswatamcode:handle-zero

Conversation

@saswatamcode
Copy link
Copy Markdown
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
}
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
Copy Markdown
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 <saswataminsta@yahoo.com>
Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
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