feat: allow to set custom timeout for route#4340
Merged
Merged
Conversation
Yiyiyimu
reviewed
May 30, 2021
Yiyiyimu
approved these changes
May 31, 2021
spacewander
requested changes
May 31, 2021
| @@ -136,8 +136,18 @@ end | |||
| -- set_balancer_opts will be called in balancer phase and before any tries | |||
| local function set_balancer_opts(ctx) | |||
| minItems = 1, | ||
| uniqueItems = true, | ||
| }, | ||
| timeout = { |
Member
There was a problem hiding this comment.
Better to exact the timeout to a separate schema.
|
|
||
|
|
||
|
|
||
| === TEST 18: valid route with timeout |
Member
There was a problem hiding this comment.
Need to add test to t/node/timeout-upstream.t
tokers
reviewed
May 31, 2021
| minItems = 1, | ||
| uniqueItems = true, | ||
| }, | ||
| upstream_timeout = { |
Contributor
There was a problem hiding this comment.
May abstract the timeout schema so it can be reused by route and upstream schema.
| | script | False | Script | See [Script](architecture-design/script.md) for more | | | ||
| | upstream | False | Upstream | Enabled Upstream configuration, see [Upstream](architecture-design/upstream.md) for more | | | ||
| | upstream_id | False | Upstream | Enabled upstream id, see [Upstream](architecture-design/upstream.md) for more | | | ||
| | upstream_timeout | False | Upstream | Set the upstream timeout for connection, sending and receiving messages of the route. This option will overwrite the [timeout](#upstream) option which set in upstream configuration. | {"connect": 3, "send": 3, "read": 3} | |
Contributor
There was a problem hiding this comment.
Suggested change
| | upstream_timeout | False | Upstream | Set the upstream timeout for connection, sending and receiving messages of the route. This option will overwrite the [timeout](#upstream) option which set in upstream configuration. | {"connect": 3, "send": 3, "read": 3} | | |
| | upstream_timeout | False | Upstream | Set the upstream timeout for connecting, sending and receiving messages of the route. This option will overwrite the [timeout](#upstream) option which set in upstream configuration. | {"connect": 3, "send": 3, "read": 3} | |
|
|
||
|
|
||
|
|
||
| === TEST 18: valid route with upstream_timeout |
Contributor
There was a problem hiding this comment.
Need further test cases to cover the usage of upstream_timeout.
spacewander
approved these changes
Jun 1, 2021
tokers
approved these changes
Jun 1, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What this PR does / why we need it:
Add optional upstream_timeout option for the route.
#4258
Pre-submission checklist: