reference
reference copied to clipboard
Using the gnmi client, not getting data after sync_response in POLL mode
I am giving the following request to gnmi client to stream data from Cisco XR router using POLL mode. I get initial data streamed once, then I get the initial sync response. But after the initial sync response, the client is stuck and no data is being streamed (even after wait of 10-15 mins). After analysis, we observed that the client is not sending poll events. Is this a bug in the client?
Request
subscribe: < encoding: 2 mode: POLL qos: < marking: 5
prefix: < origin: "openconfig-telemetry"
subscription: < path: < elem < name: "telemetry-system" > >
Response
Output by GNMI client : update: < timestamp: 1576525140860000000 prefix: < origin: "openconfig-telemetry" elem: < name: "telemetry-system" >
update: < path: < elem: < name: "sensor-groups" > elem: < name: "sensor-group" key: < key: "sensor-group-id" value: "GNMI___poll_b_0" > > elem: < name: "sensor-paths" > elem: < name: "sensor-path" key: < key: "path" value: "openconfig-telemetry:telemetry-system" > > elem: < name: "state" > elem: < name: "path" > > val: < string_val: "openconfig-telemetry:telemetry-system" >
sync_response: true
No data received after the above statement
Could someone look into this and let me know your comments?
https://github.com/openconfig/reference/blob/master/rpc/gnmi/gnmi-specification.md#35153-poll-subscriptions
A poll subscription relates to a certain set of subscribed paths, and is initiated by sending a SubscribeRequest message with encapsulated SubscriptionList.
To retrieve data from the target, a client sends a SubscribeRequest message to the target, containing a poll field, specified to be an empty Poll message.
Did subsequent poll messages after the initial request message not elicit a response?
Hi Wen, it did not return any response after the initial synchronization. The data streamed once but it stopped after the message sync_response: true is received.
For POLL subscriptions, after each set of updates for individual poll request, a SubscribeResponse message with the sync_response field set to true MUST be generated.
It reads to me here that you'd have to send a second poll request if you want to get another data snapshot. If you want the data to continually stream without another poll request, then a STREAM subscription is used.
I think my query was not clear. I am expecting POLL to work after I give it some type of input, which in most cases should be POLL or some other text. My query here is that I am not getting that prompt where I can give a trigger or input to the system to POLL the data again.
The gnmi_cli does not currently prompt the user for subsequent poll requests. There is a command line option that does trigger the poll requests to be sent on a periodic frequency.
https://github.com/openconfig/gnmi/blob/master/cmd/gnmi_cli/gnmi_cli.go#L114
Thanks Carl, I want to understand that how the flow of POLL works at present. My current observation is -
- The request is received by the router and connection is set up.
- Data is sent to the gnmi client.
- Initial synchronisation message is sent.
- <what to expect here? > What should I expect at the 4th step of the procedure here, when I am not specifying the polling interval?
From the server, you should expect a POLL request from the client and it is completely up to a given client on when to send that poll. The gnmi_cli just doesn't implement a way to trigger the poll from the command line in an interactive way today and only exercises it via a periodic call.
Thanks for the clarification Carl. In my observation, I am not observing the periodical streaming of data. In fact, I am not receiving any second stream of data itself. I want to find the cause of failure, if there is some issue on the gnmi client side or device (router) side. Can you confirm if this functionality is supported on the open source gnmi client side?
Did you try the command line option mentioned above in https://github.com/openconfig/reference/issues/114#issuecomment-576385661
What is your full command line?
If not, the gnmi_cli is not sending additional POLL requests to the server and is not exercising that functionality.