mirror of
https://github.com/grpc/grpc-node.git
synced 2025-12-08 18:23:54 +00:00
Merge remote-tracking branch 'upstream/@grpc/grpc-js@1.3.x' into grpc-js_1.3_upmerge
This commit is contained in:
commit
770ffefe5b
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@grpc/grpc-js",
|
||||
"version": "1.3.6",
|
||||
"version": "1.3.7",
|
||||
"description": "gRPC Library for Node - pure JS implementation",
|
||||
"homepage": "https://grpc.io/",
|
||||
"repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",
|
||||
|
||||
@ -660,7 +660,15 @@ export class Http2CallStream implements Call {
|
||||
this.pendingWrite.length +
|
||||
' (deferred)'
|
||||
);
|
||||
stream.write(this.pendingWrite, this.pendingWriteCallback);
|
||||
try {
|
||||
stream.write(this.pendingWrite, this.pendingWriteCallback);
|
||||
} catch (error) {
|
||||
this.endCall({
|
||||
code: Status.UNAVAILABLE,
|
||||
details: `Write failed with error ${error.message}`,
|
||||
metadata: new Metadata()
|
||||
});
|
||||
}
|
||||
}
|
||||
this.maybeCloseWrites();
|
||||
}
|
||||
@ -788,7 +796,15 @@ export class Http2CallStream implements Call {
|
||||
this.pendingWriteCallback = cb;
|
||||
} else {
|
||||
this.trace('sending data chunk of length ' + message.message.length);
|
||||
this.http2Stream.write(message.message, cb);
|
||||
try {
|
||||
this.http2Stream.write(message.message, cb);
|
||||
} catch (error) {
|
||||
this.endCall({
|
||||
code: Status.UNAVAILABLE,
|
||||
details: `Write failed with error ${error.message}`,
|
||||
metadata: new Metadata()
|
||||
});
|
||||
}
|
||||
this.maybeCloseWrites();
|
||||
}
|
||||
}, this.handleFilterError.bind(this));
|
||||
|
||||
@ -431,7 +431,7 @@ export class Http2ServerCallStream<
|
||||
private checkCancelled(): boolean {
|
||||
/* In some cases the stream can become destroyed before the close event
|
||||
* fires. That creates a race condition that this check works around */
|
||||
if (this.stream.destroyed) {
|
||||
if (this.stream.destroyed || this.stream.closed) {
|
||||
this.cancelled = true;
|
||||
}
|
||||
return this.cancelled;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user