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

fix: healthcheck to targets stopped after update upstream #100

Merged
merged 1 commit into from
Mar 31, 2022

Conversation

locao
Copy link
Contributor

@locao locao commented Mar 31, 2022

Same as #78, but rebased to release/1.4.x branch.

Original description:


Hi,

As I reported in the issue Kong/kong#7652

When I updated an upstream, healthcheck to targets of this upstream has been stopped.

The bug is by using weak table and ipairs
So, when I updated an upstream, Kong insert a new object contain upstream information to hcs table
When Lua GC removed old object of the upstream => loop with ipairs stopped when got first nil => any upstream object after nil value not will be checked

-- checker objects (weak) table
local hcs = setmetatable({}, {
    __mode = "v",
})

...

for _, checker_obj in ipairs(hcs) do

Closes: #78

@locao locao merged commit a0063cb into release/1.4.x Mar 31, 2022
@locao locao deleted the fix-healthcheck-stopped-after-update-upstream branch March 31, 2022 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants