-
Notifications
You must be signed in to change notification settings - Fork 87
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
feat: to support GRPC-GCP Extension, include additional options in grpcOptions #328
Conversation
I applied this and ran the tests we have for spanner. It seems there are options passed here from spanner (possibly other clients) that aren't valid for grpc.
This might be the reason for the filtering. The grpc options requires that it needs to be string keys with string/integer values. |
Since you have applied the fix, may I ask you to dump both |
I actually believe Spanner sets some options that previously were never seen by gRPC and now they are processed (and something goes wrong). |
Editing as there was an issue with the code I ran for it
|
I have no context here :) Happy to let @crwilcox and @kinwa91 make a call. |
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.
Approving the code change ✅
I am not super familiar with the options that grpc accepts though.. I'll let @crwilcox investigate more and figure out if this is a good change.
Changed title to better match what the purpose of this work is. cc: @WeiranFang |
src/grpc.ts
Outdated
@@ -291,7 +291,7 @@ export class GrpcClient { | |||
return this._getCredentials(options).then(credentials => { | |||
const grpcOptions: {[index: string]: {}} = {}; | |||
Object.keys(options).forEach(key => { | |||
if (key.indexOf('grpc.') === 0) { | |||
if (key.indexOf('grpc.') === 0 || key.indexOf('grpcgcp.') === 0) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
The code now does not match the tests (or vice versa). |
Holding merge until after a new version of GRPC releases. |
817c9e6
to
5562907
Compare
5562907
to
da0c090
Compare
@crwilcox pointed out that when we filter the almighty
options
object for specific gRPC-related options, we take options prefixed withgrpc.
and then pass then to gRPC as is. It turns out gRPC does not expect this prefix (see the snippet below), so let's remove it.https://github.com/grpc/grpc-node/blob/8df65a91a24b8c9e3e74d6c957cfa5905c902f86/packages/grpc-native-core/src/client.js#L367-L387