-
Notifications
You must be signed in to change notification settings - Fork 301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor the various agent HTTP clients #3017
Conversation
dc2e64b
to
e6d29f7
Compare
transport = newTransport(&conf) | ||
transportCache[cacheKey] = transport | ||
} | ||
transportCacheMu.Unlock() |
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.
Is the goal by sharing the transports here to also share the connection pooling?
Once side effect is when we call CloseIdleConnections
that impacts all clients using this transport, even if they have a different http client. I think that's ok?
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.
Yes, that's the idea, but I expect it will have very limited impact.
}), nil | ||
|
||
case strings.HasPrefix(a.conf.Destination, "s3://"): | ||
dest = "Amazon S3" | ||
return NewS3Uploader(a.logger, S3UploaderConfig{ | ||
Destination: a.conf.Destination, | ||
DebugHTTP: a.conf.DebugHTTP, |
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.
It seems like this option never did anything?
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.
Yep, set and never used.
e6d29f7
to
0f08356
Compare
0f08356
to
d025f04
Compare
Description
It'd sure be be nice to do HTTP clients consistently the same way in the agent. Then we could reuse Pat's trace work, disable HTTP/2 consistently, ...
Context
Noticed while working on artifacts, which create blank
&http.Client{}
s or usehttp.DefaultClient
.Changes
Do
, again with functional optionscontext.Background
and a deprecated methodDebugHTTP
fieldsNot changed:
GSUploader
andGSDownloader
make use ofgoogle.DefaultClient
. These remain.Testing
go test ./...
). Buildkite employees may check this if the pipeline has run automatically.go fmt ./...
)