Merge pull request #2063 from murgatroid99/grpc-js_session_destroyed_transparent_retry

grpc-js: Transparently retry session destroyed error
This commit is contained in:
Michael Lumish 2022-03-16 12:58:20 -07:00 committed by GitHub
commit 0dfe2eeb8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -468,9 +468,9 @@ export class ChannelImplementation implements Channel {
callConfig.onCommitted?.();
pickResult.onCallStarted?.();
} catch (error) {
if (
(error as NodeJS.ErrnoException).code ===
'ERR_HTTP2_GOAWAY_SESSION'
const errorCode = (error as NodeJS.ErrnoException).code;
if (errorCode === 'ERR_HTTP2_GOAWAY_SESSION' ||
errorCode === 'ERR_HTTP2_INVALID_SESSION'
) {
/* An error here indicates that something went wrong with
* the picked subchannel's http2 stream right before we