Skip to content

Commit

Permalink
Merge pull request #2882 from murgatroid99/grpc-js-xds_missing_cluste…
Browse files Browse the repository at this point in the history
…r_handling

grpc-js-xds: Start resource timers for resources requested after stream start
  • Loading branch information
murgatroid99 authored Jan 14, 2025
2 parents bfebbe7 + 198ff4e commit d9b677a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/grpc-js-xds/src/xds-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ class AdsCallState {
public typeStates: Map<XdsResourceType, ResourceTypeState> = new Map();
private receivedAnyResponse = false;
private sentInitialMessage = false;
private streamStarted = false;
constructor(public client: XdsSingleServerClient, private call: AdsCall, private node: Node) {
// Populate subscription map with existing subscriptions
for (const [authority, authorityState] of client.xdsClient.authorityStateMap) {
Expand Down Expand Up @@ -438,6 +439,9 @@ class AdsCallState {
}
if (!authorityMap.has(name.key)) {
const timer = new ResourceTimer(this, type, name);
if (this.streamStarted) {
timer.markAdsStreamStarted();
}
authorityMap.set(name.key, timer);
if (!delaySend) {
this.updateNames(type);
Expand Down Expand Up @@ -502,6 +506,7 @@ class AdsCallState {
* stream.
*/
markStreamStarted() {
this.streamStarted = true;
for (const [type, typeState] of this.typeStates) {
for (const [authority, authorityMap] of typeState.subscribedResources) {
for (const resourceTimer of authorityMap.values()) {
Expand Down

0 comments on commit d9b677a

Please sign in to comment.