Fix stream end handling in xds client

This commit is contained in:
Michael Lumish 2023-06-15 10:45:56 -07:00
parent fb98794f7b
commit 61a518c30a
1 changed files with 4 additions and 0 deletions

View File

@ -401,6 +401,7 @@ class AdsCallState {
watcher.onError(streamStatus);
}
}
this.client.handleAdsStreamEnd();
}
hasSubscribedResources(): boolean {
@ -681,6 +682,7 @@ class LrsCallState {
this.client.trace(
'ADS stream ended. code=' + status.code + ' details= ' + status.details
);
this.client.handleLrsStreamEnd();
}
private handleResponseMessage(message: LoadStatsResponse__Output) {
@ -899,6 +901,7 @@ class XdsSingleServerClient {
}
handleAdsStreamEnd() {
this.adsCallState = null;
/* The backoff timer would start the stream when it finishes. If it is not
* running, restart the stream immediately. */
if (!this.adsBackoff.isRunning()) {
@ -922,6 +925,7 @@ class XdsSingleServerClient {
}
handleLrsStreamEnd() {
this.lrsCallState = null;
/* The backoff timer would start the stream when it finishes. If it is not
* running, restart the stream immediately. */
if (!this.lrsBackoff.isRunning()) {