Skip to content

Commit f520097

Browse files
committed
http2: dial retry should respect to request timeout
1 parent 5ac0f0e commit f520097

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

http2/client_conn_pool.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,13 @@ func (p *clientConnPool) getClientConn(req *http.Request, addr string, dialOnMis
9494
traceGetConn(req, addr)
9595
call := p.getStartDialLocked(req.Context(), addr)
9696
p.mu.Unlock()
97-
<-call.done
98-
if shouldRetryDial(call, req) {
99-
continue
97+
select {
98+
case <-call.done:
99+
if shouldRetryDial(call, req) {
100+
continue
101+
}
102+
case <-req.Context().Done():
103+
return nil, req.Context().Err()
100104
}
101105
cc, err := call.res, call.err
102106
if err != nil {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy