mirror of https://github.com/grpc/grpc-node.git
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:
commit
ec334f2f44
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@grpc/grpc-js",
|
"name": "@grpc/grpc-js",
|
||||||
"version": "1.5.8",
|
"version": "1.5.9",
|
||||||
"description": "gRPC Library for Node - pure JS implementation",
|
"description": "gRPC Library for Node - pure JS implementation",
|
||||||
"homepage": "https://grpc.io/",
|
"homepage": "https://grpc.io/",
|
||||||
"repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",
|
"repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",
|
||||||
|
|
|
@ -312,6 +312,13 @@ export class Http2CallStream implements Call {
|
||||||
const filteredStatus = this.filterStack.receiveTrailers(
|
const filteredStatus = this.filterStack.receiveTrailers(
|
||||||
this.finalStatus!
|
this.finalStatus!
|
||||||
);
|
);
|
||||||
|
this.trace(
|
||||||
|
'ended with status: code=' +
|
||||||
|
filteredStatus.code +
|
||||||
|
' details="' +
|
||||||
|
filteredStatus.details +
|
||||||
|
'"'
|
||||||
|
);
|
||||||
this.statusWatchers.forEach(watcher => watcher(filteredStatus));
|
this.statusWatchers.forEach(watcher => watcher(filteredStatus));
|
||||||
/* We delay the actual action of bubbling up the status to insulate the
|
/* 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
|
* 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
|
/* If the status is OK and a new status comes in (e.g. from a
|
||||||
* deserialization failure), that new status takes priority */
|
* deserialization failure), that new status takes priority */
|
||||||
if (this.finalStatus === null || this.finalStatus.code === Status.OK) {
|
if (this.finalStatus === null || this.finalStatus.code === Status.OK) {
|
||||||
this.trace(
|
|
||||||
'ended with status: code=' +
|
|
||||||
status.code +
|
|
||||||
' details="' +
|
|
||||||
status.details +
|
|
||||||
'"'
|
|
||||||
);
|
|
||||||
this.finalStatus = status;
|
this.finalStatus = status;
|
||||||
this.maybeOutputStatus();
|
this.maybeOutputStatus();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue