Skip to content

xds: Preserve nonce for unsubscribing type on ADS stream #2875

@ejona86

Description

@ejona86

If a type was used and then fully-unsubscribed, the nonce needs to be preserved on the ads stream because the xds_protocol says:

The management server should not send a DiscoveryResponse for any DiscoveryRequest that has a stale nonce.

It appears grpc-node forgets the nonce here:

this.typeStates.delete(type);

It appears there's another bug, in that the nonce isn't per-ADS stream. That can cause re-creations of the ADS stream to never receive a response, because they are sending the wrong nonce. Either the nonce can be stored in per-ADS stream state, or can be cleared when creating a new ADS stream. The only place I see it set is here, so it doesn't seem to be cleared on new ADS stream:

typeState.nonce = result.nonce;

The xds_protocol says:

Note that the nonce is valid only in the context of an individual xDS stream; it does not survive stream restarts.

See also grpc/grpc-java#11796 and b/374697875

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions