Skip to content

Commit

Permalink
Don't send status through the filter stack twice when receiving trailers
Browse files Browse the repository at this point in the history
  • Loading branch information
murgatroid99 committed Mar 5, 2021
1 parent e3b3550 commit efc9a0f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 16 deletions.
2 changes: 1 addition & 1 deletion packages/grpc-js-xds/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@grpc/proto-loader": "^0.6.0-pre14"
},
"peerDependencies": {
"@grpc/grpc-js": "~1.2.7"
"@grpc/grpc-js": "~1.2.10"
},
"engines": {
"node": ">=10.10.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/grpc-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@grpc/grpc-js",
"version": "1.2.9",
"version": "1.2.10",
"description": "gRPC Library for Node - pure JS implementation",
"homepage": "https://grpc.io/",
"repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",
Expand Down
15 changes: 1 addition & 14 deletions packages/grpc-js/src/call-stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -442,21 +442,8 @@ export class Http2CallStream implements Call {
);
}
const status: StatusObject = { code, details, metadata };
let finalStatus;
try {
// Attempt to assign final status.
finalStatus = this.filterStack.receiveTrailers(status);
} catch (error) {
// This is a no-op if the call was already ended when handling headers.
this.endCall({
code: Status.INTERNAL,
details: 'Failed to process received status',
metadata: new Metadata(),
});
return;
}
// This is a no-op if the call was already ended when handling headers.
this.endCall(finalStatus);
this.endCall(status);
}

attachHttp2Stream(
Expand Down

0 comments on commit efc9a0f

Please sign in to comment.