File tree Expand file tree Collapse file tree
xds/src/main/java/io/grpc/xds/client Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ public void run() {
133133 xdsTransport .shutdown ();
134134 }
135135 });
136- }
136+ }r
137137
138138 @ Override
139139 public String toString () {
@@ -152,8 +152,12 @@ void adjustResourceSubscription(XdsResourceType<?> resourceType) {
152152 startRpcStream ();
153153 }
154154 Collection <String > resources = resourceStore .getSubscribedResources (serverInfo , resourceType );
155- adsStream .sendDiscoveryRequest (resourceType ,
156- resources == null ? Collections .emptySet () : resources );
155+ if (resources != null ) {
156+ adsStream .sendDiscoveryRequest (resourceType , resources );
157+ } else {
158+ // cleanup the nonce for the resource type if it's not subscribed to anymore.
159+ adsStream .respNonces .remove (resourceType );
160+ }
157161 }
158162
159163 /**
Original file line number Diff line number Diff line change @@ -291,6 +291,7 @@ public void run() {
291291 }
292292 if (resourceSubscribers .get (type ).isEmpty ()) {
293293 resourceSubscribers .remove (type );
294+ subscribedResourceTypeUrls .remove (type .typeUrl ());
294295 }
295296 }
296297 }
You can’t perform that action at this time.
0 commit comments