-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update DefaultTransport with a better MaxIdleConnsPerHost and newer f…
…ields
- Loading branch information
Showing
1 changed file
with
8 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a459706
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit has broken the library in golang 1.6 ubuntu 16.04.
INFO[0328] # github.com/hashicorp/go-cleanhttp
INFO[0328] ../github.com/hashicorp/go-cleanhttp/cleanhttp.go:29: unknown http.Transport field 'DialContext' in struct literal
INFO[0328] ../github.com/hashicorp/go-cleanhttp/cleanhttp.go:30: unknown http.Transport field 'MaxIdleConns' in struct literal
INFO[0328] ../github.com/hashicorp/go-cleanhttp/cleanhttp.go:31: unknown http.Transport field 'IdleConnTimeout' in struct literal
a459706
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Go 1.8 is just about out. Per https://golang.org/doc/devel/release.html Go 1.6 is already officially unsupported; with the release of Go 1.8 it will be unsupported even for critical security bugs. I suggest upgrading.
a459706
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jefferai, this is also a major problem for upstream projects. Is there anyway to offer a backward compatible solution? I'm guessing more people will continue to fork and revert this which is unfortunate.
a459706
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tahmee build tags can select for go version. If someone were to PR that I'd be happy to merge. But I don't have interest/time in doing that myself given that 1.6 is explicitly unsupported within a couple of days.
a459706
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My project using go1.7.4 is now busted. It does a go get of hashi vault packages and that fails before it does a git checkout 0.6.4 (crude vendoring to back to that tag)
a459706
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@richard-mauri Something is odd with your Go installation. Everything in your errors there are supported with Go 1.7; it's Go 1.6 that does not have these values. As far as I can tell, you think you are building with Go 1.7, but you're actually building with Go 1.6.
Can you ensure that you aren't setting GOROOT? Is your build script setting a path to a different Go installation? (Several distributions have Go 1.6, so if your PATH points to your own built Go, but your build script has a different path, it could be using your OS Go installation.)
a459706
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a459706
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a459706
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@richard-mauri You should probably look at vendoring, yes, if you need stable APIs.
Other than that there isn't any real way to protect/defend. I think that it's reasonable that versions of Go that have been abandoned by the Go team (e.g. for security updates) are considered to no longer be supported, and libraries move on to supported Go versions.
a459706
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a somewhat more subtle note, this commit broke code that did
because http.Transport uses DialContext preferentially over Dial.
Not saying this was a bad change to make, but just wanted to highlight that in case anyone else ran into the same issue.