Skip to content

Commit 61a518c

Browse files
committed
Fix stream end handling in xds client
1 parent fb98794 commit 61a518c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/grpc-js-xds/src/xds-client.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ class AdsCallState {
401401
watcher.onError(streamStatus);
402402
}
403403
}
404+
this.client.handleAdsStreamEnd();
404405
}
405406

406407
hasSubscribedResources(): boolean {
@@ -681,6 +682,7 @@ class LrsCallState {
681682
this.client.trace(
682683
'ADS stream ended. code=' + status.code + ' details= ' + status.details
683684
);
685+
this.client.handleLrsStreamEnd();
684686
}
685687

686688
private handleResponseMessage(message: LoadStatsResponse__Output) {
@@ -899,6 +901,7 @@ class XdsSingleServerClient {
899901
}
900902

901903
handleAdsStreamEnd() {
904+
this.adsCallState = null;
902905
/* The backoff timer would start the stream when it finishes. If it is not
903906
* running, restart the stream immediately. */
904907
if (!this.adsBackoff.isRunning()) {
@@ -922,6 +925,7 @@ class XdsSingleServerClient {
922925
}
923926

924927
handleLrsStreamEnd() {
928+
this.lrsCallState = null;
925929
/* The backoff timer would start the stream when it finishes. If it is not
926930
* running, restart the stream immediately. */
927931
if (!this.lrsBackoff.isRunning()) {

0 commit comments

Comments
 (0)