Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(43)

Issue 70120045: code review 70120045: net/http: add Client.Timeout for end-to-end timeouts (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 1 month ago by bradfitz
Modified:
9 years, 12 months ago
Reviewers:
gobot, adg, xitrium, josharian
CC:
golang-codereviews, josharian, dsymonds, niemeyer
Visibility:
Public.

Description

net/http: add Client.Timeout for end-to-end timeouts Fixes Issue 3362

Patch Set 1 #

Patch Set 2 : diff -r c9f054b74d7b https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r c9f054b74d7b https://go.googlecode.com/hg/ #

Patch Set 4 : diff -r c9f054b74d7b https://go.googlecode.com/hg/ #

Total comments: 15

Patch Set 5 : diff -r c9f054b74d7b https://go.googlecode.com/hg/ #

Total comments: 2

Patch Set 6 : diff -r d8b411485c48 https://go.googlecode.com/hg/ #

Total comments: 6

Patch Set 7 : diff -r d8b411485c48 https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+144 lines, -14 lines) Patch
M src/pkg/net/http/client.go View 1 2 3 4 5 8 chunks +77 lines, -14 lines 0 comments Download
M src/pkg/net/http/client_test.go View 1 2 1 chunk +67 lines, -0 lines 0 comments Download

Messages

Total messages: 13
bradfitz
Hello golang-codereviews@googlegroups.com (cc: adg@golang.org, dsymonds@golang.org, josharian@gmail.com, n13m3y3r@gmail.com), I'd like you to review this change to ...
10 years, 1 month ago (2014-02-28 23:00:57 UTC) #1
josharian
https://codereview.appspot.com/70120045/diff/60001/src/pkg/net/http/client.go File src/pkg/net/http/client.go (right): https://codereview.appspot.com/70120045/diff/60001/src/pkg/net/http/client.go#newcode58 src/pkg/net/http/client.go:58: // Timeout optionally specifies the end-to-end timeout for s/optionally// ...
10 years, 1 month ago (2014-02-28 23:46:04 UTC) #2
bradfitz
PTAL https://codereview.appspot.com/70120045/diff/60001/src/pkg/net/http/client.go File src/pkg/net/http/client.go (right): https://codereview.appspot.com/70120045/diff/60001/src/pkg/net/http/client.go#newcode58 src/pkg/net/http/client.go:58: // Timeout optionally specifies the end-to-end timeout for ...
10 years, 1 month ago (2014-03-01 00:00:24 UTC) #3
bradfitz
Hello golang-codereviews@googlegroups.com, josharian@gmail.com (cc: adg@golang.org, dsymonds@golang.org, golang-codereviews@googlegroups.com, n13m3y3r@gmail.com), Please take another look.
10 years, 1 month ago (2014-03-01 00:00:37 UTC) #4
josharian
A few more nits below, and the race detector is unhappy: `go test -race -run=ClientTimeout ...
10 years, 1 month ago (2014-03-01 00:32:42 UTC) #5
bradfitz
Hello golang-codereviews@googlegroups.com, josharian@gmail.com (cc: adg@golang.org, dsymonds@golang.org, golang-codereviews@googlegroups.com, n13m3y3r@gmail.com), Please take another look.
10 years, 1 month ago (2014-03-03 03:55:19 UTC) #6
bradfitz
PTAL. All done, and race fixed. On Fri, Feb 28, 2014 at 4:32 PM, <josharian@gmail.com> ...
10 years, 1 month ago (2014-03-03 03:55:27 UTC) #7
josharian
LGTM
10 years, 1 month ago (2014-03-03 04:22:15 UTC) #8
bradfitz
*** Submitted as https://code.google.com/p/go/source/detail?r=ada6f2d5f99f *** net/http: add Client.Timeout for end-to-end timeouts Fixes Issue 3362 LGTM=josharian ...
10 years, 1 month ago (2014-03-03 04:39:24 UTC) #9
gobot
This CL appears to have broken the solaris-amd64-solaris11 builder.
10 years, 1 month ago (2014-03-03 04:43:29 UTC) #10
adg
https://codereview.appspot.com/70120045/diff/100001/src/pkg/net/http/client.go File src/pkg/net/http/client.go (right): https://codereview.appspot.com/70120045/diff/100001/src/pkg/net/http/client.go#newcode58 src/pkg/net/http/client.go:58: // Timeout specifies the end-to-end timeout for requests made ...
10 years, 1 month ago (2014-03-03 04:47:14 UTC) #11
bradfitz
Done. Sent https://codereview.appspot.com/70930043 https://codereview.appspot.com/70120045/diff/100001/src/pkg/net/http/client.go File src/pkg/net/http/client.go (right): https://codereview.appspot.com/70120045/diff/100001/src/pkg/net/http/client.go#newcode58 src/pkg/net/http/client.go:58: // Timeout specifies the end-to-end timeout ...
10 years, 1 month ago (2014-03-03 22:49:43 UTC) #12
xitrium
9 years, 12 months ago (2014-04-25 18:52:56 UTC) #13
Message was sent while issue was closed.
Sorry to bring up an old draft; this patch brings up a couple questions about
CancelRequest that might be good to answer in the documentation for
CancelRequest and Timeout.

Thanks!

https://codereview.appspot.com/70120045/diff/100001/src/pkg/net/http/client.go
File src/pkg/net/http/client.go (right):

https://codereview.appspot.com/70120045/diff/100001/src/pkg/net/http/client.g...
src/pkg/net/http/client.go:298: tr.CancelRequest(req)
Won't CancelRequest's error be "use of closed network connection" and not have
Timeout() set correctly?

https://codereview.appspot.com/70120045/diff/100001/src/pkg/net/http/client.g...
src/pkg/net/http/client.go:331: reqmu.Unlock()
Is this lock and unlock necessary because CancelRequest relies on req not
changing to be goroutine safe? Should that be in the documentation for
CancelRequest or Transport? Right now it says "Clients and Transports are safe
for concurrent use by multiple goroutines and for efficiency should only be
created once and re-used."
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b