~jtv/gwacl/a8-a9

« back to all changes in this revision

Viewing changes to retry_policy.go

  • Committer: Tarmac
  • Author(s): Ian Booth
  • Date: 2013-10-31 04:28:32 UTC
  • mfrom: (226.2.2 fix-request-eof-2)
  • Revision ID: tarmac-20131031042832-91mvfvmavxd6zzy6
[r=wallyworld] [r=][bug=][author=wallyworld] The first fix for the request eof issue worked by setting
Close=true on the http request. This seemed to be not always
work so a different approach is used (same as for goose).
Set DisableKeepAlives=true on the http transport.

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
}
74
74
 
75
75
func (ret *retrier) RetryRequest(request *http.Request) (*http.Response, error) {
76
 
    // See https://code.google.com/p/go/issues/detail?id=4677
77
 
    // We need to force the connection to close each time so that we don't
78
 
    // hit the above Go bug.
79
 
    request.Close = true
80
76
    for {
81
77
        response, err := ret.client.Do(request)
82
78
        if err != nil {
107
103
}
108
104
 
109
105
func (ret *forkedHttpRetrier) RetryRequest(request *forkedHttp.Request) (*forkedHttp.Response, error) {
110
 
    // See https://code.google.com/p/go/issues/detail?id=4677
111
 
    // We need to force the connection to close each time so that we don't
112
 
    // hit the above Go bug.
113
 
    request.Close = true
114
106
    for {
115
107
        response, err := ret.client.Do(request)
116
108
        if err != nil {