Skip to content

Commit ec334f2

Browse files
authored
Merge pull request #2062 from murgatroid99/grpc-js_call_end_trace_change
grpc-js: Trace call end when actually ending the call
2 parents 0dfe2ee + 39f027e commit ec334f2

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

packages/grpc-js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@grpc/grpc-js",
3-
"version": "1.5.8",
3+
"version": "1.5.9",
44
"description": "gRPC Library for Node - pure JS implementation",
55
"homepage": "https://grpc.io/",
66
"repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",

packages/grpc-js/src/call-stream.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,13 @@ export class Http2CallStream implements Call {
312312
const filteredStatus = this.filterStack.receiveTrailers(
313313
this.finalStatus!
314314
);
315+
this.trace(
316+
'ended with status: code=' +
317+
filteredStatus.code +
318+
' details="' +
319+
filteredStatus.details +
320+
'"'
321+
);
315322
this.statusWatchers.forEach(watcher => watcher(filteredStatus));
316323
/* We delay the actual action of bubbling up the status to insulate the
317324
* cleanup code in this class from any errors that may be thrown in the
@@ -346,13 +353,6 @@ export class Http2CallStream implements Call {
346353
/* If the status is OK and a new status comes in (e.g. from a
347354
* deserialization failure), that new status takes priority */
348355
if (this.finalStatus === null || this.finalStatus.code === Status.OK) {
349-
this.trace(
350-
'ended with status: code=' +
351-
status.code +
352-
' details="' +
353-
status.details +
354-
'"'
355-
);
356356
this.finalStatus = status;
357357
this.maybeOutputStatus();
358358
}

0 commit comments

Comments
 (0)