Merge pull request #1625 from murgatroid99/grpc-js-xds_lrs_backoff_fix

grpc-js-xds: Reset LRS backoff on data, not metadata
This commit is contained in:
Michael Lumish 2020-11-13 15:57:54 -08:00 committed by GitHub
commit 33691e8490
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -1018,13 +1018,11 @@ export class XdsClient {
this.lrsBackoff.runOnce();
this.lrsCall = this.lrsClient.streamLoadStats();
this.lrsCall.on('metadata', () => {
this.lrsCall.on('data', (message: LoadStatsResponse__Output) => {
/* Once we get any response from the server, we assume that the stream is
* in a good state, so we can reset the backoff timer. */
this.lrsBackoff.stop();
this.lrsBackoff.reset();
});
this.lrsCall.on('data', (message: LoadStatsResponse__Output) => {
if (
message.load_reporting_interval?.seconds !==
this.latestLrsSettings?.load_reporting_interval?.seconds ||