openconfig / gnmic

gNMIc is a gNMI CLI client and collector
https://gnmic.openconfig.net
Apache License 2.0
177 stars 55 forks source link

gnmic retries stream subscriptions after INVALID_ARGUMENT error #516

Open cmcdona2 opened 2 months ago

cmcdona2 commented 2 months ago

Hi gnmic devs,

I'm using an OpenConfig server which (reasonably) returns a gRPC INVALIDARGUMENT / error code 3 error when I request `/system/|@~\from it (regardless of whether I'm doing agetor asubscribe, and regardless of the--stream-mode). Usinggnmicto make the request, if I usegetthen I see the INAVLID_ARGUMENT error returned. However, if I usesubscribethen I don't see any error. Internally (from within the server) I can see it logs the invalid request every 10s (probably because of the default retry period as per--retry duration ... retry timer for RPCs (default 10s)) and the INVALID_ARGUMENT error that it's returning. I thinkgnmic` should return instead of retrying if it sees that a subscription attempt returned INVALID_ARGUMENT (because the arguments aren't going to become valid on retries).

Thank you, Colin

karimra commented 2 months ago

Yes, gNMIc does not look into the error code for Subscribe. That's something that can be enhanced.