Skip to content

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

Merged
membphis merged 6 commits into
apache:masterfrom
shuaijinchao:bugfix/health/check/host
Jul 27, 2020
Merged

bugfix: failed to get host in health check configuration.#1871
membphis merged 6 commits into
apache:masterfrom
shuaijinchao:bugfix/health/check/host

Conversation

@shuaijinchao

@shuaijinchao shuaijinchao commented Jul 20, 2020

Copy link
Copy Markdown
Member

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
Copy Markdown
Member Author

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

@moonming
moonming requested review from membphis July 21, 2020 02:58
@membphis

Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread t/node/healthcheck.t
@membphis

Copy link
Copy Markdown
Member

@shuaijinchao

Is this PR backward compatible?

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

@shuaijinchao

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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