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

HTTP Client custom retry function whether this situation will be abnormal #920

Open
bubble66 opened this issue Aug 18, 2023 · 2 comments
Open
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@bubble66
Copy link

bubble66 commented Aug 18, 2023

Describe the Question

The http Client custom retry function will have an exception when canIdempotentRetry is false?
Reproducible Code

image

Expected behavior

	if canIdempotentRetry && client.DefaultRetryIf(req, resp, err) && errors.Is(err, errs.ErrBadPoolConn) {
		connAttempts++
		continue
	}

	if isDefaultRetryFunc {
		break
	}

	attempts++
	if attempts >= maxAttempts {
		break
	}

	// Check whether this request should be retried
	if canIdempotentRetry && !isRequestRetryable(req, resp, err) {
		break
	}

Would it be better to write like this?

@Duslia
Copy link
Member

Duslia commented Aug 22, 2023

It seems it's a bug. Are you interested in raising a PR to fix it?

@welkeyever
Copy link
Member

Seems it is by design - custom retry logic is process independently. Check this @li-jin-gou .

@welkeyever welkeyever added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Development

No branches or pull requests

3 participants