fix: prevent exceeding timer limitations when backing off

This commit is contained in:
Natan Sągol 2019-11-07 20:42:33 +01:00
parent 1d157dfd10
commit 845492f0b3
No known key found for this signature in database
GPG Key ID: 891FD8B48DF1A5D4

View File

@ -283,7 +283,7 @@ export class Subchannel {
* https://github.com/grpc/proposal/blob/master/A8-client-side-keepalive.md#basic-keepalive */
if (errorCode === http2.constants.NGHTTP2_ENHANCE_YOUR_CALM && opaqueData.equals(tooManyPingsData)) {
logging.log(LogVerbosity.ERROR, `Connection to ${this.channelTarget} rejected by server because of excess pings`);
this.keepaliveTimeMs *= 2;
this.keepaliveTimeMs = Math.min(2 * this.keepaliveTimeMs, KEEPALIVE_TIME_MS);
}
this.transitionToState(
[ConnectivityState.CONNECTING, ConnectivityState.READY],