reference icon indicating copy to clipboard operation
reference copied to clipboard

Using the gnmi client, not getting data after sync_response in POLL mode

Open shushukl-cisco opened this issue 5 years ago • 10 comments

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

shushukl-cisco avatar Dec 20 '19 06:12 shushukl-cisco

Could someone look into this and let me know your comments?

shushukl-cisco avatar Jan 07 '20 05:01 shushukl-cisco

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?

wenovus avatar Jan 10 '20 18:01 wenovus

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.

shushukl-cisco avatar Jan 14 '20 11:01 shushukl-cisco

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.

wenovus avatar Jan 14 '20 17:01 wenovus

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.

shushukl-cisco avatar Jan 15 '20 16:01 shushukl-cisco

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

gcsl avatar Jan 20 '20 18:01 gcsl

Thanks Carl, I want to understand that how the flow of POLL works at present. My current observation is -

  1. The request is received by the router and connection is set up.
  2. Data is sent to the gnmi client.
  3. Initial synchronisation message is sent.
  4. <what to expect here? > What should I expect at the 4th step of the procedure here, when I am not specifying the polling interval?

shushukl-cisco avatar Jan 21 '20 15:01 shushukl-cisco

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.

gcsl avatar Jan 21 '20 23:01 gcsl

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?

shushukl-cisco avatar Jan 22 '20 06:01 shushukl-cisco

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.

gcsl avatar Jan 29 '20 21:01 gcsl