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

bugfix: failed to get host in health check configuration. #1871

Merged
merged 6 commits into from
Jul 27, 2020

Conversation

shuaijinchao
Copy link
Member

@shuaijinchao shuaijinchao commented Jul 20, 2020

What this PR does / why we need it:

Pre-submission checklist:

FIX #1869

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible?

@shuaijinchao
Copy link
Member Author

@membphis the test case cannot get the warn log thrown by the health check, please help to check.

@membphis
Copy link
Member

I check the source code, and I found two points.

the healthcheck was ignored

  1. if the count of upstream node is 1, it will return the upstream node directly, the healthcheck was ignored.

https://github.com/apache/incubator-apisix/blob/master/apisix/balancer.lua#L180-L185

I think we can create a new PR to fix this bug first.

The health check prints the log only when the status of the upstream node is changed

The default status is SUCCESS, if the status is SUCCESS always, we never can get a log like healthy SUCCESS.

@shuaijinchao
Copy link
Member Author

I check the source code, and I found two points.

the healthcheck was ignored

  1. if the count of upstream node is 1, it will return the upstream node directly, the healthcheck was ignored.

https://github.com/apache/incubator-apisix/blob/master/apisix/balancer.lua#L180-L185

I think we can create a new PR to fix this bug first.

The health check prints the log only when the status of the upstream node is changed

The default status is SUCCESS, if the status is SUCCESS always, we never can get a log like healthy SUCCESS.

  1. If the number of nodes is 1 and the node is a faulty node, the health check is of little significance at this time, and APISIX will also have a retry mechanism.
  2. adding a faulty node to trigger the status change of the health check, the verification of the test case is completed.

Thanks @membphis for your help.

@membphis
Copy link
Member

@shuaijinchao

Is this PR backward compatible?

I think this PR is not backward compatible. please confirm this.

@shuaijinchao
Copy link
Member Author

@shuaijinchao

Is this PR backward compatible?

I think this PR is not backward compatible. please confirm this.

@membphis this is a bug fix, using the previous data structure, so it is backward compatible.

@membphis
Copy link
Member

@membphis this is a bug fix, using the previous data structure, so it is backward compatible.

ok, got it. let us merge this PR.

@membphis membphis merged commit a108d2e into apache:master Jul 27, 2020
@membphis
Copy link
Member

@shuaijinchao merged, many thx

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: failed to get host in health check configuration.
2 participants