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

transport : wait for goroutines to exit before transport closes #7666

Merged
merged 17 commits into from
Oct 10, 2024
Merged
Prev Previous commit
Next Next commit
correcting comments
  • Loading branch information
eshitachandwani committed Sep 25, 2024
commit b24f606a454b49648ebf44e5ccb3e09df877abf1
2 changes: 1 addition & 1 deletion internal/transport/http2_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
// goAway is closed to notify the upper layer (i.e., addrConn.transportMonitor)
// that the server sent GoAway on this transport.
goAway chan struct{}
//keepAliveDone channel is closed when the keepAlive go routine exits
// This channel is closed when the keepAlive goroutine exits.
keepAliveDone chan struct{}
framer *framer
// controlBuf delivers all the control related tasks (e.g., window
Expand Down Expand Up @@ -1342,7 +1342,7 @@
id := f.LastStreamID
if id > 0 && id%2 == 0 {
t.mu.Unlock()
return connectionErrorf(true, nil, "received goaway with non-zero even-numbered stream id: %v", id)

Check warning on line 1345 in internal/transport/http2_client.go

View check run for this annotation

Codecov / codecov/patch

internal/transport/http2_client.go#L1345

Added line #L1345 was not covered by tests
}
// A client can receive multiple GoAways from the server (see
// https://github.com/grpc/grpc-go/issues/1387). The idea is that the first
Expand All @@ -1359,7 +1359,7 @@
// If there are multiple GoAways the first one should always have an ID greater than the following ones.
if id > t.prevGoAwayID {
t.mu.Unlock()
return connectionErrorf(true, nil, "received goaway with stream id: %v, which exceeds stream id of previous goaway: %v", id, t.prevGoAwayID)

Check warning on line 1362 in internal/transport/http2_client.go

View check run for this annotation

Codecov / codecov/patch

internal/transport/http2_client.go#L1362

Added line #L1362 was not covered by tests
}
default:
t.setGoAwayReason(f)
Expand Down