-
Notifications
You must be signed in to change notification settings - Fork 801
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
Created GRPC handlers and internal clients #4057
Merged
vytautas-karpavicius
merged 17 commits into
uber:master
from
vytautas-karpavicius:grpc-handlers
Apr 15, 2021
Merged
Created GRPC handlers and internal clients #4057
vytautas-karpavicius
merged 17 commits into
uber:master
from
vytautas-karpavicius:grpc-handlers
Apr 15, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Mar 24, 2021
Merged
vytautas-karpavicius
force-pushed
the
grpc-handlers
branch
from
March 25, 2021 12:04
65e1087
to
3e13d18
Compare
vytautas-karpavicius
force-pushed
the
grpc-handlers
branch
from
March 25, 2021 12:32
3e13d18
to
bcc0d28
Compare
vytautas-karpavicius
force-pushed
the
grpc-handlers
branch
from
March 25, 2021 18:27
752dbeb
to
829602f
Compare
vytautas-karpavicius
force-pushed
the
grpc-handlers
branch
from
March 26, 2021 08:56
829602f
to
eaa82bb
Compare
vytautas-karpavicius
force-pushed
the
grpc-handlers
branch
from
March 26, 2021 12:30
e13c364
to
bdd384d
Compare
Shaddoll
reviewed
Apr 13, 2021
Shaddoll
reviewed
Apr 13, 2021
serviceName string, | ||
hostName string, | ||
) (*yarpc.Dispatcher, error) { | ||
grpcAddress, err := d.grpcPorts.GetGRPCAddress(serviceName, hostName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we assuming that all instances use the same grpc port on different hosts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, at least for open source version here.
just-at-uber
approved these changes
Apr 14, 2021
yux0
pushed a commit
to yux0/cadence
that referenced
this pull request
May 4, 2021
* Created GRPC handlers and internal clients * GRPC port config for remaining config files * Fix metric tags for grpc handlers * Proper mapping for WorkflowExecutionCloseStatus * Return yarpcerrors.Status with no match * Updated changelog * Fix after merge * Do not fatal on outbound dispatcher failure * Updated integration tests * Minor rename * Fix after merge
pregnor
added a commit
to banzaicloud/banzai-charts
that referenced
this pull request
May 31, 2021
pregnor
added a commit
to banzaicloud/banzai-charts
that referenced
this pull request
May 31, 2021
pregnor
added a commit
to banzaicloud/banzai-charts
that referenced
this pull request
May 31, 2021
pregnor
added a commit
to banzaicloud/banzai-charts
that referenced
this pull request
May 31, 2021
pregnor
added a commit
to banzaicloud/banzai-charts
that referenced
this pull request
May 31, 2021
pregnor
added a commit
to banzaicloud/banzai-charts
that referenced
this pull request
May 31, 2021
4 tasks
pregnor
added a commit
to banzaicloud/banzai-charts
that referenced
this pull request
May 31, 2021
pregnor
added a commit
to banzaicloud/banzai-charts
that referenced
this pull request
May 31, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changed?
This change introduces GRPC handlers and internal clients. It brings simultaneous support for TChannel/Thrift and GRPC/protobuf within cadence server.
For this to work, it opens up new port GRPC port. For consistency all GRPC ports are
-100
from Thrift ports. For example:On this new port new YARPC inbound is configured to accept GRPC traffic. New GRPC handlers were created to accepts proto encoded requests. They are converted to internal types and passed along to the main handler to process.
The outbound GRPC communication between server components is off by default, and can be enabled with dynamic config flag:
system.enableGRPCOutbound
. If enabled all requests will be encoded to proto messages within newly added GRPC clients. Additionally those clients are created with a different GRPC dispatcher.When making an outbound call we need to know GRPC port. This is a little bit tricky, as all addresses are resolved using ringpop, which automatically carries TChannel port. Thus we need to drop it and append grpc port by using a lookup from additionally passed service configuration.
Why?
To migration Cadence to GRPC.
How did you test it?
Integration tests were updated to use GPRC configuration by default.
Locally passing cadence canary with GRPC communication enabled.
Potential risks
There may be some mapping issues between proto and internal types that were not noticed yet. Some of them were caught by with integration and canary tests. To reduce risk, proto communication is off by default and will be enabled with dynamic config. Additionally all frontend metrics are tagged with grpc/thrift flag, which will allow observing error increase when switching to grpc dynamically. Mitigation is easy - switching back to Thrift.