Skip to content
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

Closed
wants to merge 4 commits into from

Conversation

tzssangglass
Copy link
Member

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

  • The Pull Request has tests
  • A changelog file has been created under changelog/unreleased/kong or skip-changelog label added on PR if changelog is unnecessary. README.md
  • There is a user-facing docs PR against https://github.com/Kong/docs.konghq.com - PUT DOCS PR HERE

Issue reference

Fix: (FTI-5616)[https://konghq.atlassian.net/browse/FTI-5616]

…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>
@github-actions github-actions bot added the cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee label Mar 20, 2024
Signed-off-by: tzssangglass <tzssangglass@gmail.com>
Signed-off-by: tzssangglass <tzssangglass@gmail.com>
@tzssangglass tzssangglass marked this pull request as ready for review March 20, 2024 09:02
spec/02-integration/05-proxy/10-balancer/08-retry_spec.lua Outdated Show resolved Hide resolved
kong/init.lua Show resolved Hide resolved
@@ -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"
Copy link
Contributor

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?

Copy link
Member Author

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>
@tzssangglass
Copy link
Member Author

wait for Kong/lua-kong-nginx-module#85

@tzssangglass tzssangglass marked this pull request as draft April 19, 2024 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants