Open garrettdieckmann opened 3 years ago
From trying to troubleshoot on a repro box, this seems to be triggered from an attempt to destroy the stream after server returns a null response:
https://github.com/f5devcentral/grpc-js-0.2-modified/blob/master/build/src/client.js#L70
Which calls cancelWithStatus https://github.com/f5devcentral/grpc-js-0.2-modified/blob/master/build/src/call-stream.js#L329
Which then calls https://github.com/f5devcentral/grpc-js-0.2-modified/blob/master/build/src/call-stream.js#L320
(Trace from a modified src on repro box)
Err on stream.close:"Not enough responses received"
at Http2CallStream.destroyHttp2Stream (..../node_modules/grpc-js-0.2-modified/build/src/call-stream.js:329:19)
at Http2CallStream.cancelWithStatus (...../node_modules/grpc-js-0.2-modified/build/src/call-stream.js:334:14)
at Http2CallStream.call.on (...../node_modules/grpc-js-0.2-modified/build/src/client.js:70:22)
at emitNone (events.js:111:20)
at Http2CallStream.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1064:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
Looks like http2Stream is not correctly being dereferenced/set to null in this instance, so it passes the check and close attempt is made:
destroyHttp2Stream() {
// The http2 stream could already have been destroyed if cancelWithStatus
// is called in response to an internal http2 error.
if (this.http2Stream !== null && !this.http2Stream.destroyed) {
/* TODO(murgatroid99): Determine if we want to send different RST_STREAM
* codes based on the status code */
this.http2Stream.close(NGHTTP2_CANCEL);
}
}
When using this library in F5 Telemetry Streaming, we observe frequent restarts of the restnoded process with the following in the log file:
This looks similar to the work that was done when forking this library, of replacing the
.close()
functions: https://github.com/f5devcentral/grpc-js-0.2-modified#this-is-a-modified-version-of-grpc-js-version-02Expected behavior: Exception is caught and handled, or the function call is updated so that it does not call a non-existent function for NodeJS v8.11.1.