feat(translator): Implement BTP Timeout API#2454
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #2454 +/- ##
==========================================
- Coverage 64.70% 64.61% -0.09%
==========================================
Files 116 116
Lines 17613 17797 +184
==========================================
+ Hits 11396 11500 +104
- Misses 5486 5560 +74
- Partials 731 737 +6 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
can we use lower case here to make the func private - setBackend....
internal/ir/xds.go
Outdated
There was a problem hiding this comment.
prefer if this was renamed to Timeout and we moved the existing Timeout field into it and renamed it to RequestTimeout under HTTP
internal/xds/translator/cluster.go
Outdated
There was a problem hiding this comment.
these two duration should be checked (whether is nil ptr) before assign values toIdleTimeout and MaxConnectionDuration, nor it will raise a nil pointer panic.
http:
- name: "first-listener"
#...
routes:
- name: "first-route"
backendTimeout:
tcp:
connectTimeout: "31s"
http:
connectionIdleTimeout: "32s"
#maxConnectionDuration: "33s" # paniced
#...8485b19 to
ab06b32
Compare
There was a problem hiding this comment.
This implementation LGTM, thanks!
A minor comment on the name of Timeout structure in the API: we may want to change it to BackendTimeout because the TCP ConnectTimeout can't be reused for the future client-side Timeouts.
// BackendTimeout defines configuration for timeouts related to the backend.
type BackendTimeout struct {
// Timeout settings for TCP.
//
// +optional
TCP *TCPTimeout `json:"tcp,omitempty"`
// Timeout settings for HTTP.
//
// +optional
HTTP *HTTPTimeout `json:"http,omitempty"`
}
Can we translate this to transport socket timeout for downstream connections? If so, it can be reused... |
internal/gatewayapi/route.go
Outdated
There was a problem hiding this comment.
nit: policy is computed/translated post route translation, so we can assume its empty here
There was a problem hiding this comment.
I wanted to this to be safe in case there's a re-arrangement of the computation order. If you feel that we can make this assumption, i'll update the implementation accordingly.
There was a problem hiding this comment.
sure, if thats the case, can you also add a comment here, so the next dev can understand why this done this way similar to the comment you have in policy around request timeout
There was a problem hiding this comment.
we should log error in status and continue processing instead of returning early here
There was a problem hiding this comment.
what happened here, why did 5s get deleted ?
There was a problem hiding this comment.
test is broken, probably needs below config
timeout:
http:
requestTimeout: 5s
Not sure about it, they look similar but not exactly the same. Are there any other possible different settings between client and backend timeouts? |
the go struct name can be changed anytime w/o breaking YAML API compatibility so no strong comments for now from my side |
ab06b32 to
f556086
Compare
|
Regarding E2E test for this feature: echo server does support a
One way to verify timeout settings with an e2e test is to trigger some upstream connections, wait for timeouts to occur and then check the relevant envoy cluster metrics. I propose to handle the e2e test in a dedicated issue. |
|
sure @guydc lets raise seperate GH issues for e2e and docs and tackle those in different PRs |
Signed-off-by: Guy Daich <guy.daich@sap.com>
f556086 to
ed5ca57
Compare
|
/retest |
What this PR does / why we need it:
Implement the BackendTrafficPolicy Timeout API
Which issue(s) this PR fixes:
Fixes #2401