Skip to content

net/http: Client / Transport deadlock #2616

Closed
@gopherbot

Description

@gopherbot

by yoshiyuki.kanno@stoic.co.jp:

What steps will reproduce the problem?
1. Invoke massive http requests by http.(Get|Head|...) to a same domain(for using pconn).

2. When switching goroutine between "http.(*persistConn).expectingResponse()"
and "http.(*persistConn).close()" in http.readLoop, scheduled goroutine
invoking http requests  will get into dead locked in
"http.(*persistConn).roundTrip". because  "responseAndError" will
never get data.

What is the expected output?
http.(*Transport).RoundTrip should return with an appropriate error.

What do you see instead?
To prevent getting into this dead locked, the critical region of
"http.(*persistConn).expectingResponse()" should include
"http.(*persistConn).close()".


Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
Linux ubuntu11 3.0.0-12-server x86_64
Linux CentOS6 2.6.18-238.12.1.el5 x86_64

Which revision are you using?  (hg identify)
c1702f36df03 (release-branch.r60) release/release.r60.3
8e23f5bdc859 tip

Please provide any additional information below.
attached a quick patch for r60.3

Attachments:

  1. transport.patch (3956 bytes)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions