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

internal/transport: do not mask ConnectionError #4561

Merged
merged 2 commits into from Jun 28, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion internal/transport/http2_client.go
Expand Up @@ -878,7 +878,13 @@ func (t *http2Client) Close(err error) {
// for understanding the root cause for this connection to be closed.
_, goAwayDebugMessage := t.GetGoAwayReason()
if len(goAwayDebugMessage) > 0 {
err = fmt.Errorf("closing transport due to: %v, received prior goaway: %v", err, goAwayDebugMessage)
tmpErr := true
originalErr := err
if ce, ok := err.(ConnectionError); ok {
tmpErr = ce.Temporary()
originalErr = ce.Origin()
}
err = connectionErrorf(tmpErr, originalErr, "closing transport due to: %v, received prior goaway: %v", originalErr, goAwayDebugMessage)
}
// Notify all active streams.
for _, s := range streams {
Expand Down