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

tonic: Introduce a new method on Endpoint to override the origin #1013

Merged
merged 2 commits into from Jun 20, 2022

Conversation

QuentinPerez
Copy link
Contributor

@QuentinPerez QuentinPerez commented Jun 12, 2022

Motivation

At @znly, we use Envoy as a service mesh to distribute the traffic across the services.
Meaning that:

  • we have an auto-scaled farm of Envoy which proxy the entire traffic.
  • we have to refresh the IPs periodically (due to auto-scaling).
  • we have to talk to the IPs directly.

That said, the requests end with an unavailable error, why? because Envoy is called with the URI (the IP in our case) and can't determine which service we are trying to reach.

Solution

A new method named origin has been added to override the origin sent.
We tried it in production and it's working fine.
Let me know if you have a better solution.

@QuentinPerez
Copy link
Contributor Author

@LucioFranco 👋🏻
Let me know if you need more explanation or time to review this PR

Copy link
Member

@LucioFranco LucioFranco left a comment

Choose a reason for hiding this comment

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

LGTM only thing missing I think is a simple unit test.

tonic/src/transport/channel/endpoint.rs Show resolved Hide resolved
Copy link
Member

@LucioFranco LucioFranco left a comment

Choose a reason for hiding this comment

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

Thanks!

@LucioFranco LucioFranco merged commit 4388d82 into hyperium:master Jun 20, 2022
@QuentinPerez
Copy link
Contributor Author

QuentinPerez commented Jun 20, 2022

@LucioFranco thx ! do you think that we could have a minor soon ? do not want to stay on my fork too long :)

@LucioFranco
Copy link
Member

I think we can get a release out pretty soon here, I just need to consider if we want to make a prost release as well which might delay tonic's. So hopefully this week if not next week.

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.

None yet

2 participants