-
Notifications
You must be signed in to change notification settings - Fork 22
feat: support get last peer connection cached #82
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
Conversation
apply this feat in Kong maybe like: diff --git a/kong/init.lua b/kong/init.lua
index d37a08325..667b99e30 100644
--- a/kong/init.lua
+++ b/kong/init.lua
@@ -95,6 +95,7 @@ local wasm = require "kong.runloop.wasm"
local reports = require "kong.reports"
local pl_file = require "pl.file"
local req_dyn_hook = require "kong.dynamic_hook"
+local peer_conn = require("resty.kong.peer_conn")
local kong = kong
@@ -1278,6 +1279,7 @@ function Kong.balancer()
-- record failure data
local previous_try = tries[try_count - 1]
previous_try.state, previous_try.code = get_last_failure()
+ previous_try.cached = peer_conn.get_last_peer_connection_cached()
-- Report HTTP status for health checks
local balancer_instance = balancer_data.balancer
@@ -1330,6 +1332,8 @@ function Kong.balancer()
if retries > 0 then
set_more_tries(retries)
end
+
+ tries[try_count].cached = 0
end adding a "cached" field in the looks like
|
�Does It only work in http subsystem? Should we support it in stream subsystem? Another style suggestion: we should always have two blank lines to separate function and other code block. |
I think we don't need to support in stream subsystem, because it is a patch of |
ping @dndx , PTAL |
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.
Could you write a README doc for this new feature? It is hard to understand what it does without one.
add |
Signed-off-by: tzssangglass <[email protected]>
Signed-off-by: tzssangglass <[email protected]>
Signed-off-by: tzssangglass <[email protected]>
Signed-off-by: tzssangglass <[email protected]>
Signed-off-by: tzssangglass <[email protected]>
Signed-off-by: tzssangglass <[email protected]>
Signed-off-by: tzssangglass <[email protected]>
Signed-off-by: tzssangglass <[email protected]>
Signed-off-by: tzssangglass <[email protected]>
Signed-off-by: tzssangglass <[email protected]>
Signed-off-by: tzssangglass <[email protected]>
Signed-off-by: tzssangglass <[email protected]>
Signed-off-by: tzssangglass <[email protected]>
@tzssangglass very nice documentation, I merged your PR |
…cached` (#82)" This reverts commit d1f8aaf. Signed-off-by: tzssangglass <[email protected]>
…cached` (#82)" This reverts commit d1f8aaf. Signed-off-by: tzssangglass <[email protected]>
Signed-off-by: tzssangglass [email protected]
Fix: https://konghq.atlassian.net/browse/FTI-5616