Merge pull request #2062 from murgatroid99/grpc-js_call_end_trace_change

grpc-js: Trace call end when actually ending the call
This commit is contained in:
Michael Lumish 2022-03-16 12:58:29 -07:00 committed by GitHub
commit ec334f2f44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@grpc/grpc-js",
"version": "1.5.8",
"version": "1.5.9",
"description": "gRPC Library for Node - pure JS implementation",
"homepage": "https://grpc.io/",
"repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",

View File

@ -312,6 +312,13 @@ export class Http2CallStream implements Call {
const filteredStatus = this.filterStack.receiveTrailers(
this.finalStatus!
);
this.trace(
'ended with status: code=' +
filteredStatus.code +
' details="' +
filteredStatus.details +
'"'
);
this.statusWatchers.forEach(watcher => watcher(filteredStatus));
/* We delay the actual action of bubbling up the status to insulate the
* cleanup code in this class from any errors that may be thrown in the
@ -346,13 +353,6 @@ export class Http2CallStream implements Call {
/* If the status is OK and a new status comes in (e.g. from a
* deserialization failure), that new status takes priority */
if (this.finalStatus === null || this.finalStatus.code === Status.OK) {
this.trace(
'ended with status: code=' +
status.code +
' details="' +
status.details +
'"'
);
this.finalStatus = status;
this.maybeOutputStatus();
}