Skip to content

Commit

Permalink
http2: dial retry should respect to request timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
Taction committed Jun 4, 2024
1 parent 5ac0f0e commit f520097
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions http2/client_conn_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,13 @@ func (p *clientConnPool) getClientConn(req *http.Request, addr string, dialOnMis
traceGetConn(req, addr)
call := p.getStartDialLocked(req.Context(), addr)
p.mu.Unlock()
<-call.done
if shouldRetryDial(call, req) {
continue
select {
case <-call.done:
if shouldRetryDial(call, req) {
continue
}
case <-req.Context().Done():
return nil, req.Context().Err()
}
cc, err := call.res, call.err
if err != nil {
Expand Down

0 comments on commit f520097

Please sign in to comment.