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

Issue 4351048: code review 4351048: http: fix Transport connection re-use race (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 1 month ago by bradfitz
Modified:
13 years, 1 month ago
Reviewers:
CC:
rsc, adg, golang-dev
Visibility:
Public.

Description

http: fix Transport connection re-use race A connection shouldn't be made available for re-use until its body has been consumed. (except in the case of pipelining, which isn't implemented yet) This CL fixes some issues seen with heavy load against Amazon S3. Subtle implementation detail: to prevent a race with the client requesting a new connection before previous one is returned, we actually have to call putIdleConnection _before_ we return from the final Read/Close call on the http.Response.Body.

Patch Set 1 #

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

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

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+38 lines, -19 lines) Patch
M src/pkg/http/transport.go View 1 2 chunks +29 lines, -17 lines 0 comments Download
M src/pkg/http/transport_test.go View 1 3 chunks +9 lines, -2 lines 0 comments Download

Messages

Total messages: 4
bradfitz
Hello rsc, adg (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
13 years, 1 month ago (2011-04-05 01:59:43 UTC) #1
adg
LGTM But wait for rsc, I suppose.
13 years, 1 month ago (2011-04-05 02:11:42 UTC) #2
rsc
LGTM
13 years, 1 month ago (2011-04-05 02:17:45 UTC) #3
bradfitz
13 years, 1 month ago (2011-04-05 02:22:52 UTC) #4
*** Submitted as http://code.google.com/p/go/source/detail?r=e7238799f6de ***

http: fix Transport connection re-use race

A connection shouldn't be made available
for re-use until its body has been consumed.

(except in the case of pipelining, which isn't
implemented yet)

This CL fixes some issues seen with heavy load
against Amazon S3.

Subtle implementation detail: to prevent a race
with the client requesting a new connection
before previous one is returned, we actually
have to call putIdleConnection _before_ we
return from the final Read/Close call on the
http.Response.Body.

R=rsc, adg
CC=golang-dev
http://codereview.appspot.com/4351048
Sign in to reply to this message.

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