Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(269)

Issue 2562293002: common/lhttp: close the Response.Body on non-200s (Closed)

Created:
4 years ago by djd-OOO-Apr2017
Modified:
4 years ago
Reviewers:
M-A Ruel, mcgreevy
CC:
chromium-reviews, infra-reviews+luci-go_chromium.org, maruel+w_chromium.org, tandrii+luci-go_chromium.org
Target Ref:
refs/heads/master
Project:
luci-go
Visibility:
Public.

Description

common/lhttp: close the Response.Body on non-200s Refactor lhttp NewRequest to make sure that the response's body is always drained/closed in the case that the handler is not invoked (for 5xx responses, etc.). Add text to the returned error from NewRequest to make it how many attempts were attempted before failing. BUG=671592 Review-Url: https://codereview.chromium.org/2562293002 Committed: https://github.com/luci/luci-go/commit/64707122e72f7405ce9b04b38323cf8bbf7cbf2d

Patch Set 1 #

Patch Set 2 : fix typos #

Total comments: 7

Patch Set 3 : Reorder struct fields #

Unified diffs Side-by-side diffs Delta from patch set Stats (+123 lines, -28 lines) Patch
M common/lhttp/client.go View 1 3 chunks +28 lines, -20 lines 0 comments Download
M common/lhttp/client_test.go View 1 2 6 chunks +95 lines, -8 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 20 (10 generated)
djd-OOO-Apr2017
4 years ago (2016-12-12 06:21:35 UTC) #2
djd-OOO-Apr2017
4 years ago (2016-12-12 06:24:47 UTC) #4
M-A Ruel
Ugh thanks. Only one style nit. https://codereview.chromium.org/2562293002/diff/20001/common/lhttp/client_test.go File common/lhttp/client_test.go (right): https://codereview.chromium.org/2562293002/diff/20001/common/lhttp/client_test.go#newcode285 common/lhttp/client_test.go:285: if got, want ...
4 years ago (2016-12-12 17:16:39 UTC) #5
M-A Ruel
On 2016/12/12 17:16:39, M-A Ruel wrote: > Ugh thanks. I meant lgtm, duh. :) > ...
4 years ago (2016-12-12 17:16:52 UTC) #6
mcgreevy
https://codereview.chromium.org/2562293002/diff/20001/common/lhttp/client_test.go File common/lhttp/client_test.go (left): https://codereview.chromium.org/2562293002/diff/20001/common/lhttp/client_test.go#oldcode128 common/lhttp/client_test.go:128: ut.AssertEqual(t, true, errors.IsTransient(err)) Why are you removing these IsTransient ...
4 years ago (2016-12-12 23:57:39 UTC) #7
djd-OOO-Apr2017
https://codereview.chromium.org/2562293002/diff/20001/common/lhttp/client_test.go File common/lhttp/client_test.go (left): https://codereview.chromium.org/2562293002/diff/20001/common/lhttp/client_test.go#oldcode128 common/lhttp/client_test.go:128: ut.AssertEqual(t, true, errors.IsTransient(err)) On 2016/12/12 23:57:39, mcgreevy2 wrote: > ...
4 years ago (2016-12-13 00:18:09 UTC) #8
M-A Ruel
https://codereview.chromium.org/2562293002/diff/20001/common/lhttp/client_test.go File common/lhttp/client_test.go (right): https://codereview.chromium.org/2562293002/diff/20001/common/lhttp/client_test.go#newcode285 common/lhttp/client_test.go:285: if got, want := status, http.StatusOK; got != want ...
4 years ago (2016-12-13 01:55:59 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2562293002/40001
4 years ago (2016-12-13 02:10:10 UTC) #16
mcgreevy
lgtm
4 years ago (2016-12-13 02:16:00 UTC) #17
commit-bot: I haz the power
4 years ago (2016-12-13 02:22:09 UTC) #20
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://github.com/luci/luci-go/commit/64707122e72f7405ce9b04b38323cf8bbf7cbf2d

Powered by Google App Engine
This is Rietveld 408576698