mirror of https://github.com/grpc/grpc-node.git
Merge pull request #1286 from murgatroid99/grpc-js_auto_retry_code_check
grpc-js: Only automatically retry picks on known error
This commit is contained in:
commit
2c40be8884
|
|
@ -265,6 +265,7 @@ export class ChannelImplementation implements Channel {
|
|||
callStream
|
||||
);
|
||||
} catch (error) {
|
||||
if ((error as NodeJS.ErrnoException).code === 'ERR_HTTP2_GOAWAY_SESSION') {
|
||||
/* An error here indicates that something went wrong with
|
||||
* the picked subchannel's http2 stream right before we
|
||||
* tried to start the stream. We are handling a promise
|
||||
|
|
@ -288,6 +289,18 @@ export class ChannelImplementation implements Channel {
|
|||
'. Retrying pick'
|
||||
);
|
||||
this.tryPick(callStream, callMetadata);
|
||||
} else {
|
||||
trace(
|
||||
LogVerbosity.INFO,
|
||||
'channel',
|
||||
'Failed to start call on picked subchanel ' +
|
||||
pickResult.subchannel!.getAddress() +
|
||||
' with error ' +
|
||||
(error as Error).message +
|
||||
'. Ending call'
|
||||
);
|
||||
callStream.cancelWithStatus(Status.INTERNAL, 'Failed to start HTTP/2 stream');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* The logic for doing this here is the same as in the catch
|
||||
|
|
|
|||
Loading…
Reference in New Issue