Skip to content

fix: retry on GOAWAY errors when using cached HTTP/2 connections#491

Open
0xuLiang wants to merge 1 commit intoimroc:masterfrom
0xuLiang:fix-goaway-retry
Open

fix: retry on GOAWAY errors when using cached HTTP/2 connections#491
0xuLiang wants to merge 1 commit intoimroc:masterfrom
0xuLiang:fix-goaway-retry

Conversation

@0xuLiang
Copy link
Copy Markdown

RoundTripOnlyCachedConn bypasses the retry loop in RoundTripOpt, so GOAWAY and other retryable errors were returned directly to callers.

Now we check CanRetryError before returning, allowing retryable errors to fall through and create a new connection.

Changes:

  • Export canRetryError as CanRetryError
  • Check CanRetryError in roundTrip when RoundTripOnlyCachedConn fails

Fixes #376

RoundTripOnlyCachedConn bypasses the retry loop in RoundTripOpt, so
GOAWAY and other retryable errors were returned directly to callers.

Now we check CanRetryError before returning, allowing retryable errors
to fall through and create a new connection.

Changes:
- Export canRetryError as CanRetryError
- Check CanRetryError in roundTrip when RoundTripOnlyCachedConn fails
@bertold
Copy link
Copy Markdown

bertold commented May 9, 2026

I could not wait for a tagged release. If you need a release with the above fix you can get it from github.com/bertold/req v3.57.2 - note that this repo is a hard fork.

@0xuLiang
Copy link
Copy Markdown
Author

0xuLiang commented May 10, 2026

I could not wait for a tagged release. If you need a release with the above fix you can get it from github.com/bertold/req v3.57.2 - note that this repo is a hard fork.

I checked in bertold/req and didn't see this fix included. I've submitted PR bertold#3 with the fix. Looking forward to your review.

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.

使用 HTTP/2 时经常触发错误

3 participants