-
Notifications
You must be signed in to change notification settings - Fork 598
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
grpc: listen for metadata event instead of status #1444
grpc: listen for metadata event instead of status #1444
Conversation
@imathews would you mind testing this branch out to see if it resolves your issues? |
}; | ||
|
||
fakeStream | ||
.on('response', function(resp) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -325,7 +325,8 @@ GrpcService.prototype.requestStream = function(protoOpts, reqOpts) { | |||
|
|||
request: function() { | |||
return service[protoOpts.method](reqOpts, grpcOpts) | |||
.on('status', function(status) { | |||
.on('metadata', function() { | |||
var status = this.received_status || { code: 0 }; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
.on('status', function(status) { | ||
var grcpStatus = GrpcService.decorateStatus_(status); | ||
.on('metadata', function() { | ||
var grcpStatus = GrpcService.decorateStatus_({ code: 0 }); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Thanks :D |
This is now working beautifully. Many many thanks @callmehiphop for the quick resolution! |
Closes #1443
This fixes an issue where a grpc readable stream would hang indefinitely because we weren't draining it. Instead of listening for a status event, which occurs after results have been processed, we're now going to listen instead for a metadata event.