Skip to content

Commit 5db8649

Browse files
authored
Merge pull request #1873 from murgatroid99/grpc-js_server_cancelled_closed
grpc-js: Check for closed server stream before sending
2 parents 6bc620a + af52072 commit 5db8649

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
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.3.6",
3+
"version": "1.3.7",
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/server-call.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ export class Http2ServerCallStream<
429429
private checkCancelled(): boolean {
430430
/* In some cases the stream can become destroyed before the close event
431431
* fires. That creates a race condition that this check works around */
432-
if (this.stream.destroyed) {
432+
if (this.stream.destroyed || this.stream.closed) {
433433
this.cancelled = true;
434434
}
435435
return this.cancelled;

0 commit comments

Comments
 (0)