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(balancer) use correct upstream object in event handler #3319

Merged
merged 1 commit into from
Mar 20, 2018

Conversation

hishamhm
Copy link
Contributor

In the upstream event handler, create_balancer was being called with the object received via the event, which contains "id" and "name" only, and not the entire entity table containing the rest of the upstream fields. This caused it create a healthchecker with an empty configuration (ignoring the user's configuration), which then fell back into the lua-resty-healthcheck defaults.

This fix obtains the proper entity object from the id and passes it to create_balancer.

A regression test is included, which spawns two Kong instances and reproduces the error scenario described by @mengskysama.

This commit is against master, but can be cherry-picked against next with no conflicts.

Fixes #3304.

In the upstream event handler, `create_balancer` was being called
with the object received via the event, which contains "id" and
"name" only, and not the entire entity table containing the rest
of the upstream fields. This caused it create a healthchecker with
an empty configuration (ignoring the user's configuration),
which then fell back into the lua-resty-healthcheck defaults.

This fix obtains the proper entity object from the id and passes
it to `create_balancer`.

A regression test is included, which spawns two Kong instances
and reproduces the error scenario described by @mengskysama.

Fixes #3304.
@thibaultcha thibaultcha merged commit f8fa0c0 into master Mar 20, 2018
@thibaultcha thibaultcha deleted the fix/upstream-event branch March 20, 2018 21:09
thibaultcha pushed a commit that referenced this pull request Mar 20, 2018
In the upstream event handler, `create_balancer` was being called
with the object received via the event, which contains "id" and
"name" only, and not the entire entity table containing the rest
of the upstream fields. This caused it create a healthchecker with
an empty configuration (ignoring the user's configuration),
which then fell back into the lua-resty-healthcheck defaults.

This fix obtains the proper entity object from the id and passes
it to `create_balancer`.

A regression test is included, which spawns two Kong instances
and reproduces the error scenario described by @mengskysama.

Fixes #3304 
From #3319
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.

bug: Passive healthcheck can't disable
2 participants