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

The design of .Retry() is wrong #168

Open
beef9999 opened this issue Oct 12, 2017 · 4 comments
Open

The design of .Retry() is wrong #168

beef9999 opened this issue Oct 12, 2017 · 4 comments

Comments

@beef9999
Copy link

beef9999 commented Oct 12, 2017

        for {
		resp, body, errs = s.getResponseBytes()
		if errs != nil {
			return nil, nil, errs
		}
		if s.isRetryableRequest(resp) {
			resp.Header.Set("Retry-Count", strconv.Itoa(s.Retryable.Attempt))
			break
		}
	}

The current .Retry() mechanism only works when server successfully responds with a specific set of http codes. But in other scenarios, http requests might fail because of network connectivity problem, insufficient OS resource, etc, which will only exit at the first return(see above) , without proper retries.

@zuoRambo
Copy link

Agree with you! When the error returned by client.Do is not nil, we should retry.

@jayi
Copy link

jayi commented Jan 24, 2018

+1

1 similar comment
@edshv
Copy link

edshv commented Jun 21, 2018

+1

@edshv
Copy link

edshv commented Jun 21, 2018

Also, any retry logic specified in Client/transport is overwritten

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

No branches or pull requests

4 participants