Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
br: configure the httpclient for external storage #46040
br: configure the httpclient for external storage #46040
Changes from 2 commits
4d7a529
99a8e82
da99398
1818e5d
0d32dcb
a373296
dceea44
a439ba2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check warning on line 165 in br/pkg/storage/azblob.go
Codecov / codecov/patch
br/pkg/storage/azblob.go#L165
Check warning on line 182 in br/pkg/storage/azblob.go
Codecov / codecov/patch
br/pkg/storage/azblob.go#L182
Check warning on line 199 in br/pkg/storage/azblob.go
Codecov / codecov/patch
br/pkg/storage/azblob.go#L199
Check warning on line 221 in br/pkg/storage/azblob.go
Codecov / codecov/patch
br/pkg/storage/azblob.go#L218-L221
Check warning on line 236 in br/pkg/storage/azblob.go
Codecov / codecov/patch
br/pkg/storage/azblob.go#L235-L236
Check warning on line 254 in br/pkg/storage/azblob.go
Codecov / codecov/patch
br/pkg/storage/azblob.go#L253-L254
Check warning on line 284 in br/pkg/storage/azblob.go
Codecov / codecov/patch
br/pkg/storage/azblob.go#L283-L284
Check warning on line 313 in br/pkg/storage/azblob.go
Codecov / codecov/patch
br/pkg/storage/azblob.go#L312-L313
Check warning on line 178 in br/pkg/storage/storage.go
Codecov / codecov/patch
br/pkg/storage/storage.go#L176-L178
Check warning on line 211 in br/pkg/storage/storage.go
Codecov / codecov/patch
br/pkg/storage/storage.go#L210-L211
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.
Can we avoid to hard code them but copy attributes from http.DefaultTransport
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.
the
http.DefaultTransport
is a interface type( interfaceRoundTripper
), so we only can force convert back to Transport and ignore the possible error.And it has some fields, such as sync.Mutex and map, I'm worried that the copy leaves behind the risk of golang updating.
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.
I also like @BornChanger 's idea. We can add an unit test to detect the future implementation change of interface
RoundTripper
, and useTransport.Clone
to correctly handle its private fields.Check warning on line 232 in br/pkg/storage/storage.go
Codecov / codecov/patch
br/pkg/storage/storage.go#L216-L232
Check warning on line 138 in br/pkg/task/stream.go
Codecov / codecov/patch
br/pkg/task/stream.go#L138
Check warning on line 1475 in br/pkg/task/stream.go
Codecov / codecov/patch
br/pkg/task/stream.go#L1475