Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

fix(balancer) recover after dns updates #73

Merged
merged 2 commits into from Aug 7, 2019
Merged

fix(balancer) recover after dns updates #73

merged 2 commits into from Aug 7, 2019

Conversation

Tieske
Copy link
Member

@Tieske Tieske commented Aug 2, 2019

Since the health was introduced on the balancer, there is an early
exit if the balancer is unhealthy. This introduced a problem where
DNS record would remain untouched, and hence would not be refreshed.
Leaving the balancer in an unhealthy state forever.

issue: Kong/kong#4781

@Tieske Tieske self-assigned this Aug 2, 2019
Since the health was introduced on the balancer, there is an early
exit if the balancer is unhealthy. This introduced a problem where
DNS record would remain untouched, and hence would not be refreshed.
Leaving the balancer in an unhealthy state forever.

A background timer is added to check and update records every second.

issue: Kong/kong#4781
README.md Outdated Show resolved Hide resolved
src/resty/dns/balancer/base.lua Outdated Show resolved Hide resolved
src/resty/dns/balancer/base.lua Outdated Show resolved Hide resolved
@locao
Copy link
Contributor

locao commented Aug 7, 2019

We could change in src/resty/dns/client.lua:1510

if _TEST then    -- luacheck: ignore

by

if package.loaded["busted"] then

and remove the _G._TEST = true in tests to avoid a lot of warnings.

Co-Authored-By: Enrique García Cota <kikito@gmail.com>
@Tieske Tieske merged commit 4ee0d70 into master Aug 7, 2019
@Tieske Tieske deleted the auto-refresh branch August 7, 2019 21:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants