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

agent/xds: Update mesh gateway to use service router timeout #7444

Merged
merged 3 commits into from
Mar 17, 2020

Conversation

findkim
Copy link
Contributor

@findkim findkim commented Mar 13, 2020

The PR updates the connection timeout used for services behind a mesh gateway to prioritize the configured service-resolver timeout, and falls back to use the timeout of the mesh gateway.

Fixes #6370

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.

This looks to all function correctly but I found the flow in the cluster generation a little hard to follow. Could you take a look and see if there is a reasonable way to refactor. If all other alternatives are "ugly" then maybe just adding a few comments (like at that continue and outside of the hasResolver block) indicating how the control-flow should be working.

agent/xds/clusters.go Outdated Show resolved Hide resolved
return nil, err
}
clusters = append(clusters, cluster)
continue
Copy link
Member

Choose a reason for hiding this comment

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

It was immediately clear to me why there was a continue here. I eventually figured it out that it was to avoid the code below when we already know we don't have a resolver (to prevent some segfaults)

Could there be a way to refactor this code a little to make the code flow a little clearer? Maybe a way that we only generate the unnamed subsets cluster in 1 location?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated! Happy to improve readability

@findkim findkim requested a review from mkeeler March 13, 2020 16:27
@findkim findkim force-pushed the mesh-gateway-connect-timeout branch from 5b6dc61 to a4a9849 Compare March 13, 2020 18:47
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

@findkim findkim force-pushed the mesh-gateway-connect-timeout branch from a4a9849 to 609ce45 Compare March 17, 2020 18:27
@findkim findkim merged commit bef693d into hashicorp:master Mar 17, 2020
@findkim findkim deleted the mesh-gateway-connect-timeout branch March 17, 2020 19:50
hashicorp-ci pushed a commit that referenced this pull request Mar 17, 2020
* website/connect/proxy/envoy: specify timeout precedence for services behind mesh gateway
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.

mesh gateways should use service-resolver ConnectTimeouts if configured
2 participants