Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/0.4' into 0.4-writer
Browse files Browse the repository at this point in the history
  • Loading branch information
Achille Roussel committed Aug 7, 2020
2 parents 1f8e499 + b0b1cdc commit 4a3000a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ func (g *connGroup) grabConnOrConnect(ctx context.Context) (*conn, error) {
errChan := make(chan error)

go func() {
c, err := g.connect()
c, err := g.connect(ctx)
if err != nil {
select {
case errChan <- err:
Expand Down Expand Up @@ -972,10 +972,10 @@ func (g *connGroup) releaseConn(c *conn) bool {
return true
}

func (g *connGroup) connect() (*conn, error) {
func (g *connGroup) connect(ctx context.Context) (*conn, error) {
deadline := time.Now().Add(g.pool.dialTimeout)

ctx, cancel := context.WithDeadline(context.Background(), deadline)
ctx, cancel := context.WithDeadline(ctx, deadline)
defer cancel()

var network = strings.Split(g.addr.Network(), ",")
Expand Down

0 comments on commit 4a3000a

Please sign in to comment.