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

Connect: Make Connect health queries unblock correctly #5508

Merged
merged 3 commits into from
Mar 21, 2019

Conversation

banks
Copy link
Member

@banks banks commented Mar 19, 2019

Fixes #5506.

Addresses an issue found while investigating connect proxy service discovery. The issue is described in #5506 but can be summed up by: watching the target service index is not the right thing to do in most cases when requesting /health/connect/:service results.

This fixes the issue as well as adding much more robust tests that explicitly caught failing cases of the old implementation.

This extends the optimization in #5449. In the Connect query case we don't always guarantee just a single chan to watch because the proxies returned might be named as multiple different service names. In addition since we don't know the set of all proxy service names that may be used, we need to always watch the actual index iterator for new instances being registered with a name we didn't watch already.

In the typical case though where all connect proxies are named consistently, connect queries still only require two watch chans. If there are both (consistently named) proxies and connect-native instances for a service then that increases to 3. If Connect proxies are added with random names then it may increase further but this seems an extremely unlikely case and would likely be unmanageable for other reasons too.

@banks banks requested a review from a team March 19, 2019 13:08
@banks banks added the theme/connect Anything related to Consul Connect, Service Mesh, Side Car Proxies label Mar 19, 2019
Copy link
Member

@mkeeler mkeeler left a comment

Choose a reason for hiding this comment

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

LGTM

@banks banks merged commit d2e68a9 into master Mar 21, 2019
@banks banks deleted the fix-connect-health-blocking branch March 21, 2019 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/connect Anything related to Consul Connect, Service Mesh, Side Car Proxies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Connect: health API blocking doesn't notice changes to proxy health checks
2 participants