-
Notifications
You must be signed in to change notification settings - Fork 655
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
Name resolution load balancing #1015
Name resolution load balancing #1015
Conversation
packages/grpc-js/src/channel.ts
Outdated
); | ||
}, | ||
}; | ||
// TODO: check channel arg for default service config |
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.
Add your username to the TODO
@@ -138,7 +138,9 @@ class UnknownHandler extends CompressionHandler { | |||
compressMessage(message: Buffer): Promise<Buffer> { | |||
return Promise.reject<Buffer>( | |||
new Error( | |||
`Received message compressed wth unsupported compression method ${this.compressionName}` | |||
`Received message compressed wth unsupported compression method ${ |
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.
That's a bit of a weird looking change. What's the reasoning?
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.
I think this came from the code formatter.
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.
There’s a typo in wth
— it should be with
.
packages/grpc-js/src/index.ts
Outdated
import * as resolver from './resolver'; | ||
import * as load_balancer from './load-balancer'; | ||
|
||
function setup() { |
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.
The typical paradigm for these is rather something along these lines:
(function() {
resolver.registerAll();
load_balancer.registerAll();
}());
Good job on these bugs. I think this PR might fix 2 problems we're currently experiencing. Do you have any estimations on when it should be released? |
@felipegcampos We want to get it out soon, but it's a lot of code so it's going to take some time for it to be reviewed. |
Perfect. I was reviewing myself. However, I don't know if I'm of much help since I have not been checking the codebase since we started with grpc. However, let me know if I can help somehow. |
This commit fixes a typo from grpc#1015
This commit fixes a typo observed in grpc#1015
This adds a custom name resolver and load balancer internal API with basic implementations. The name resolver implementation handles retrieving and service config data from DNS TXT records, but most of the service config options are not implemented. The only implemented load balancer implementation is "pick first". It will attempt to establish connections to every address returned by the resolver, and will use whichever one connects first.
This change fixes the following bugs:
Calls on channels that quickly fail to establish a connection will end with an
UNAVAILABLE
error instead of waiting forever or until the call deadline. ThewaitForReady
option to override that behavior is now supported. (Make grpc-js not wait for ready by default #896)Channels with no calls no longer keep the event loop alive. (grpc-js: A channel that never connects keeps the process alive #767)
Some parts of this design are not in this PR and will be added in future PRs: