-
Notifications
You must be signed in to change notification settings - Fork 689
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
Added configurable upstream connect timeout #4326
Conversation
0a87f4d
to
e13a253
Compare
Signed-off-by: Tero Saarni <tero.saarni@est.tech>
e13a253
to
22ddb70
Compare
Codecov Report
@@ Coverage Diff @@
## main #4326 +/- ##
==========================================
+ Coverage 77.84% 78.29% +0.44%
==========================================
Files 112 112
Lines 10029 10052 +23
==========================================
+ Hits 7807 7870 +63
+ Misses 2043 2001 -42
- Partials 179 181 +2
|
pkg/config/parameters.go
Outdated
@@ -463,6 +471,10 @@ func (t TimeoutParameters) Validate() error { | |||
return fmt.Errorf("connection shutdown grace period %q: %w", t.ConnectionShutdownGracePeriod, err) | |||
} | |||
|
|||
if err := v(t.ConnectTimeout); err != nil { |
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.
using v()
here will allow infinity
as a valid timeout, which we probably don't want, as you mentioned elsewhere
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.
Missed that, thanks @sunjayBhatia! Now fixed.
Signed-off-by: Tero Saarni <tero.saarni@est.tech>
72df8b4
to
807d0e6
Compare
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.
Looks reasonable to me, just a couple godoc nits
Signed-off-by: Tero Saarni <tero.saarni@est.tech>
…nfig CRD to result in default timeout Signed-off-by: Tero Saarni <tero.saarni@est.tech>
36387e5
to
a264744
Compare
Thanks! I've fixed the field names. I also realized that default 2s timeout was not taking place anymore with empty ContourConfiguration, which I fixed as well. |
I guess similar to other discussions, do we want to have the default take place via kubebuilder as well? |
internal/envoy/v3/cluster_test.go
Outdated
"cluster with connect timeout set": { | ||
cluster: &dag.Cluster{ | ||
Upstream: service(s1), | ||
ConnectTimeout: 2 * time.Second, |
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.
nit: since the test merges the want and default cluster config, maybe use a different value to ensure theres no chance a mistake in implementation still makes this test pass
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.
Good catch, changed to 10 seconds.
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.
just one small comment on a test but otherwise lgtm
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.
LGTM pending Sunjay's comment
Let's bring this in without a kubebuilder default for now, and I'll come back to what we can do there next week. |
Signed-off-by: Tero Saarni <tero.saarni@est.tech>
cd25844
to
4fcadcf
Compare
Signed-off-by: Tero Saarni <tero.saarni@est.tech>
4fcadcf
to
5c7808e
Compare
In addition to fixing @sunjayBhatia's comment I've also added connect timeout to |
* Added configurable upstream connect timeout Signed-off-by: Tero Saarni <tero.saarni@est.tech>
This change adds optional configurable timeout for upstream TCP connections. Currently Envoy is programmed with a hardcoded value of 2 seconds. With this change, user will be able to change this global timeout by setting a variable in the config file or
ContourConfiguration
.Fixes #2264
Signed-off-by: Tero Saarni tero.saarni@est.tech