Skip to content

Commit

Permalink
Merge pull request #1436 from murgatroid99/grpc-js_dont_push_after_end
Browse files Browse the repository at this point in the history
grpc-js: Don't push messages after ending a call
  • Loading branch information
murgatroid99 authored Jun 3, 2020
2 parents 8482928 + ed5b3ac commit 861695b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/grpc-js/src/call-stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,13 @@ export class Http2CallStream implements Call {
);
this.canPush = false;
process.nextTick(() => {
/* If we have already output the status any later messages should be
* ignored, and can cause out-of-order operation errors higher up in the
* stack. Checking as late as possible here to avoid any race conditions.
*/
if (this.statusOutput) {
return;
}
this.listener?.onReceiveMessage(message);
this.maybeOutputStatus();
});
Expand Down

0 comments on commit 861695b

Please sign in to comment.