-
Notifications
You must be signed in to change notification settings - Fork 782
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
Add Transport config parameter for MaxConnsPerHost #1858
Conversation
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.
Hey @ccapurso! These changes make sense to me.
I'm not super familiar with this code so did a review by comparing how a similar field(I chose MaxIdleConnsPerHost
) is implemented. I noticed a couple additional changes with MaxIdleConnsPerHost
:
- transport.go GoString() - it doesn't look like all transport fields are in the GoString. I'm not sure if it would be worthwhile to add
MaxConnsPerHost
here? - config_test.go TestParse - it looks like adding a test case for
MaxConnsPerHost
might keep parity? - cli.go ParseFlags() - would it make sense to add flag support for this field?
Totally okay ifMaxConnsPerHost
doesn't make sense to be in the 3 places above, so just want to get your input.
Another question mostly because I'm not familiar with things, would you mind sharing a little bit about how you tested these changes? Appreciate it, thank you
@lornasong, thank you for the review! I have addressed the three spots you mentioned:
I tested using the reproduction steps provided in #1840 and ensured that the connections were limited based on the configured maximum. |
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.
thanks @ccapurso! the changes make sense to me
Rendering templates within Vault Agent that contain many secrets can result in aggressively opening a very large number of TCP connections all at once. Opening this many connections essentially results in a DoS against Vault. This PR adds the ability to specify a value for
MaxConnsPerHost
within a client's Transport configuration. Support for this new field was only added for the Vault client.Fixes #1840