Skip to content

net/http: Transport.CancelRequest doesn't work on connections blocked in dial #6951

@gopherbot

Description

@gopherbot

by isaac.dawson:

Before filing a bug, please check whether it has been fixed since the
latest release. Search the issue tracker and check that you're running the
latest version of Go:

Run "go version" and compare against
http://golang.org/doc/devel/release.html  If a newer version of Go exists,
install it and retry what you did to reproduce the problem.

Thanks.

What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. Set timeouts for connect/read for http.Client's transport
2. Make request to stupid HTTPS website which doesn't properly handshake
3. Watch as it never kills the connection
4. Ref: http://play.golang.org/p/gyI1e5UoPq

What is the expected output?
Timeouts should be in effect and kill the connection.

What do you see instead?
Absolutely nothing happen.

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

Which operating system are you using?
Windows 8.1

Which version are you using?  (run 'go version')
go version go1.2 windows/amd64
https://code.google.com/p/go/downloads/detail?name=go1.2.windows-amd64.zip&;can=2&q=OpSys-Windows+Type%3DArchive

Please provide any additional information below.
This may or may not be related to https://golang.org/issue/3362. I
definitely noticed a higher chance of HTTPS sites refusing to 'let go' of their
connections. When trying to crawl lots of sites, it becomes impossible because workers
become blocked and I can't seem to kill the connection.

This actually happens a lot when attempting to crawl the Alexa Top 1 million sites, lots
of sites appear to accept the connection but just hold on to them indefinitely.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions