Fix some trace logs, increase XdsClient keepalive interval

This commit is contained in:
Michael Lumish 2020-08-27 14:17:29 -07:00
parent c83d5a7c4d
commit 1a47f78f4f
3 changed files with 7 additions and 6 deletions

View File

@ -54,12 +54,12 @@ class XdsResolver implements Resolver {
// Wait until updateResolution is called once to start the xDS requests
if (!this.resolutionStarted) {
this.resolutionStarted = true;
trace('Starting resolution for target ' + this.target);
trace('Starting resolution for target ' + uriToString(this.target));
const xdsClient = new XdsClient(
this.target.path,
{
onValidUpdate: (update: ServiceConfig) => {
trace('Resolved service config for target ' + this.target + ': ' + JSON.stringify(update));
trace('Resolved service config for target ' + uriToString(this.target) + ': ' + JSON.stringify(update));
this.hasReportedSuccess = true;
this.listener.onSuccessfulResolution([], update, null, {
xdsClient: xdsClient,
@ -69,12 +69,12 @@ class XdsResolver implements Resolver {
/* A transient error only needs to bubble up as a failure if we have
* not already provided a ServiceConfig for the upper layer to use */
if (!this.hasReportedSuccess) {
trace('Resolution error for target ' + this.target + ' due to xDS client transient error ' + error.details);
trace('Resolution error for target ' + uriToString(this.target) + ' due to xDS client transient error ' + error.details);
this.reportResolutionError();
}
},
onResourceDoesNotExist: () => {
trace('Resolution error for target ' + this.target + ': resource does not exist');
trace('Resolution error for target ' + uriToString(this.target) + ': resource does not exist');
this.reportResolutionError();
},
},

View File

@ -417,7 +417,7 @@ export class Subchannel {
);
logging.log(
LogVerbosity.ERROR,
`Connection to ${uriToString(this.channelTarget)} at ${this.subchannelAddressString} rejected by server because of excess pings. Increasing ping interval to ${this.keepaliveTimeMs}`
`Connection to ${uriToString(this.channelTarget)} at ${this.subchannelAddressString} rejected by server because of excess pings. Increasing ping interval to ${this.keepaliveTimeMs} ms`
);
}
trace(

View File

@ -777,7 +777,8 @@ export class XdsClient {
for (const arg of channelArgsToRemove) {
delete channelArgs[arg];
}
channelArgs['grpc.keepalive_time_ms'] = 5000;
// 5 minutes
channelArgs['grpc.keepalive_time_ms'] = 5 * 60 * 1000;
this.adsBackoff = new BackoffTimeout(() => {
this.maybeStartAdsStream();