Merge pull request #1436 from murgatroid99/grpc-js_dont_push_after_end

grpc-js: Don't push messages after ending a call
This commit is contained in:
Michael Lumish 2020-06-03 16:33:48 -07:00 committed by GitHub
commit 861695bc28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -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();
});