Skip to content

Commit

Permalink
*: fix issue found in fast lease renew
Browse files Browse the repository at this point in the history
  • Loading branch information
xiang90 authored and gyuho committed Jul 18, 2016
1 parent d68936c commit 842145e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions lease/leasehttp/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ func RenewHTTP(id lease.LeaseID, url string, rt http.RoundTripper, timeout time.
return -1, err
}
b, err := ioutil.ReadAll(resp.Body)
resp.Body.Close()
if err != nil {
return -1, err
}
Expand Down
3 changes: 3 additions & 0 deletions pkg/transport/timeout_transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ func NewTimeoutTransport(info TLSInfo, dialtimeoutd, rdtimeoutd, wtimeoutd time.
// the timed out connection will timeout soon after it is idle.
// it should not be put back to http transport as an idle connection for future usage.
tr.MaxIdleConnsPerHost = -1
} else {
// allow more idle connections between peers to avoid unncessary port allocation.
tr.MaxIdleConnsPerHost = 1024
}

tr.Dial = (&rwTimeoutDialer{
Expand Down

0 comments on commit 842145e

Please sign in to comment.