-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
feat(balancer): record the cache flag of each connection which used during balancer retry #12760
Conversation
…uring balancer retry enhanced the functionality of the load balancer to record the cache flag of each connection attempt. this provides better visibility into whether a connection was reused from the upstream connection pool. Fix: (FTI-5616)[https://konghq.atlassian.net/browse/FTI-5616] Signed-off-by: tzssangglass <tzssangglass@gmail.com>
Signed-off-by: tzssangglass <tzssangglass@gmail.com>
@@ -1278,6 +1278,10 @@ function Kong.balancer() | |||
-- record failure data | |||
local previous_try = tries[try_count - 1] | |||
previous_try.state, previous_try.code = get_last_failure() | |||
if ngx.config.subsystem == "http" then | |||
local peer_conn = require "resty.kong.peer_conn" |
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.
Do we have any reason to require this library in runtime code path?
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.
require at the top of the file will cause it to fail when running it in the stream.
Signed-off-by: tzssangglass <tzssangglass@gmail.com>
wait for Kong/lua-kong-nginx-module#85 |
Summary
enhanced the functionality of the load balancer to record the cache flag of each connection attempt. this provides better visibility into whether a connection was reused from the upstream connection pool.
Checklist
changelog/unreleased/kong
orskip-changelog
label added on PR if changelog is unnecessary. README.mdIssue reference
Fix: (FTI-5616)[https://konghq.atlassian.net/browse/FTI-5616]