-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Use http.Client instead of http.Get #1133
Comments
@aman-bansal do you think we should allow users to specify such parameters on a case by case basis or should we introduce good-enough default? |
There are two ways to look at this:
What I think is we should define one parameter in metadata for each scaler (where timeouts make sense) with good enough default value. |
I agree with both of those points @aman-bansal, but I would add that we should allow users to set a global timeout should they desire. I would like to work on this. I'll send a draft PR as a start. |
fixes kedacore#1133 Signed-off-by: Aaron Schlesinger <[email protected]>
fixes kedacore#1133 Signed-off-by: Aaron Schlesinger <[email protected]> reading timeout from env var, and storing HTTP client in ScalerConfig Signed-off-by: Aaron Schlesinger <[email protected]> fixing undeclared name client Signed-off-by: Aaron Schlesinger <[email protected]>
fixes kedacore#1133 Signed-off-by: Aaron Schlesinger <[email protected]> reading timeout from env var, and storing HTTP client in ScalerConfig Signed-off-by: Aaron Schlesinger <[email protected]> fixing undeclared name client Signed-off-by: Aaron Schlesinger <[email protected]>
fixes kedacore#1133 Signed-off-by: Aaron Schlesinger <[email protected]> reading timeout from env var, and storing HTTP client in ScalerConfig Signed-off-by: Aaron Schlesinger <[email protected]> fixing undeclared name client Signed-off-by: Aaron Schlesinger <[email protected]>
fixes kedacore#1133 Signed-off-by: Aaron Schlesinger <[email protected]> reading timeout from env var, and storing HTTP client in ScalerConfig Signed-off-by: Aaron Schlesinger <[email protected]> fixing undeclared name client Signed-off-by: Aaron Schlesinger <[email protected]>
fixes kedacore#1133 Signed-off-by: Aaron Schlesinger <[email protected]> reading timeout from env var, and storing HTTP client in ScalerConfig Signed-off-by: Aaron Schlesinger <[email protected]> fixing undeclared name client Signed-off-by: Aaron Schlesinger <[email protected]>
fixes kedacore#1133 Signed-off-by: Aaron Schlesinger <[email protected]>
Created kedacore/charts#109 to surface this in our Helm chart as well. |
@aman-bansal after #1758, I don't see anywhere else that uses raw |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
This has been done, we can close this issue. |
) Signed-off-by: dttung2905 <[email protected]>
At many places, HTTP requests have been implemented using default HTTP client like
r, err := http.Get(s.metadata.url)
. As per HTTP package, default client is defined like thisvar DefaultClient = &Client{}
. This has huge drawbacks as it doesn't allow the application to define timeout behaviors (among other things). The default value of timeout is 0 which means no timeout. In production environments, this could prove costly. The more intuitive way would be to create your own client likeand http.NewRequest() to create new requests.
The text was updated successfully, but these errors were encountered: