Skip to content

Commit

Permalink
Merge pull request #2387 from murgatroid99/grpc-js_trace_receive_message
Browse files Browse the repository at this point in the history
grpc-js: Add more logging to trace handling of received messages
  • Loading branch information
murgatroid99 committed Mar 7, 2023
2 parents 7aba000 + 7916181 commit 9264d58
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/grpc-js/src/resolving-call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,17 @@ export class ResolvingCall implements Call {
this.filterStack = this.filterStackFactory.createFilter();
this.filterStack.sendMetadata(Promise.resolve(this.metadata)).then(filteredMetadata => {
this.child = this.channel.createInnerCall(config, this.method, this.host, this.credentials, this.deadline);
this.trace('Created child [' + this.child.getCallNumber() + ']')
this.child.start(filteredMetadata, {
onReceiveMetadata: metadata => {
this.trace('Received metadata')
this.listener!.onReceiveMetadata(this.filterStack!.receiveMetadata(metadata));
},
onReceiveMessage: message => {
this.trace('Received message');
this.readFilterPending = true;
this.filterStack!.receiveMessage(message).then(filteredMesssage => {
this.trace('Finished filtering received message');
this.readFilterPending = false;
this.listener!.onReceiveMessage(filteredMesssage);
if (this.pendingChildStatus) {
Expand All @@ -195,6 +199,7 @@ export class ResolvingCall implements Call {
});
},
onReceiveStatus: status => {
this.trace('Received status');
if (this.readFilterPending) {
this.pendingChildStatus = status;
} else {
Expand Down

0 comments on commit 9264d58

Please sign in to comment.