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

ui: [BUGFIX] Fix missing or duplicate service instance health checks #9660

Merged
merged 3 commits into from
Jan 29, 2021

Conversation

johncowen
Copy link
Contributor

@johncowen johncowen commented Jan 28, 2021

Fixes #9648

This PR fixes essentially two issue related to the listing of healthchecks correctly.

In #9314 we changed our separate Proxy/ServiceInstance models to use a single ServiceInstance model extending from the Proxy model. This meant we had a single model to represent a Service Instance that happened to be a connect sidecar proxy. Unfortunately we didn't realize a clash of property names when we did this, both the Proxy endpoint and the ServiceInstance endpoint contain a Node property that are two different shapes. One is a plain string that is the name of the node and one is a map/object containing all the properties of a node (including its name), "name" vs {Name: "name"}.

In #9524 we added a fix that added a NodeName property and mapped the string based Node property to that instead, meaning these special ProxyServiceInstance models have both NodeName= "name" and Node = {Name: "name"...}.

Unfortunately we missed that we were using the Node property to link our instances and proxy instances together. This updates this code to use the NodeName property.

Additionally we noticed that proxy instance healthchecks could potentially accumulate instead of being replaced when blocking queries would respond, eternally adding more and more duplicate healthchecks to a proxy service instance.

The second fix here solves this by resetting the checks array before copying over the healthchecks to the proxy service instance.

@johncowen johncowen added type/bug Feature does not function as expected theme/ui Anything related to the UI backport/1.9 labels Jan 28, 2021
@johncowen johncowen added this to the 1.9.x milestone Jan 28, 2021
Copy link
Contributor

@kaxcode kaxcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@johncowen johncowen marked this pull request as ready for review January 29, 2021 15:39
@johncowen johncowen merged commit 7c277aa into master Jan 29, 2021
@johncowen johncowen deleted the ui/bugfix/healthchecks-listings branch January 29, 2021 15:51
@hashicorp-ci
Copy link
Contributor

🍒 If backport labels were added before merging, cherry-picking will start automatically.

To retroactively trigger a backport after merging, add backport labels and re-run https://circleci.com/gh/hashicorp/consul/319581.

@hashicorp-ci
Copy link
Contributor

🍒✅ Cherry pick of commit 7c277aa onto release/1.9.x succeeded!

hashicorp-ci pushed a commit that referenced this pull request Jan 29, 2021
…9660)

* Use NodeName not Node for cross checking proxies/instances

* Also copy over the meta data to keep the correct cursor/index

* When we sync checks to the ProxyInstance replace rather than accumulate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/ui Anything related to the UI type/bug Feature does not function as expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consul Web-UI only shows health checks for one instance.
3 participants