mirror of https://github.com/grpc/grpc-node.git
Don't send status through the filter stack twice when receiving trailers
This commit is contained in:
parent
e3b35505a0
commit
efc9a0f05c
|
@ -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"
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue