Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarification request: initial updates for POLL subscription #89

Closed
iljatab opened this issue Jan 30, 2018 · 7 comments
Closed

Clarification request: initial updates for POLL subscription #89

iljatab opened this issue Jan 30, 2018 · 7 comments

Comments

@iljatab
Copy link

iljatab commented Jan 30, 2018

It isn't, IMHO, clear if POLL subscription requires the target system to send an initial update in an "unsolicited" way.

The specification version 0.4.0, secion "3.5.1.5.3 POLL Subscriptions" does not mention any initial update from the target, instead it states:
"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."

Based on that one can understand that for POLL subscription the target should not send any initial update by itself. Updates are triggered strictly by client via "Poll" message (of course the first update, triggered by client, would contain a complete data set and further updates just updated objects). Such behavior looks reasonable to me because POLL subscription implies... hmmm... polling operation mode.

The specification version "0.5.0" didn't change section 3.5.1.5.3.
However it added SubscribeRequest::updates_only field, described as:

3.5.1.2 The SubscriptionList Message
"updates_only - a boolean ...
For POLL and ONCE subscriptions, the target should send only the sync_response message, before proceeding to process poll requests (in the case of POLL) or closing the RPC (in the case of ONCE)."

3.5.2.3 Sending Telemetry Updates
"In the case where the updates_only field in the SubscribeRequest message has been set, a sync_response is sent as the first message on the stream, followed by any updates representing subsequent changes to current state. For a POLL or ONCE mode, this means that only a sync_response will be sent."

So specification for "updates_only" implies that initial update must be sent by target for POLL subscription (either update + sync_response or naked sync_response if updates_only is set).

What is the correct procedure - to send or not to send?
Would be great to get an authoritative clarification.
Please point me to an appropriate document if I missed something.

@ostappus
Copy link

I agree, it's still not clear as of v0.8.1. @wenovus, can you please clarify if initial sync is expected at the start, before receiving Poll messages?

@gcsl
Copy link
Contributor

gcsl commented Aug 17, 2022

Yes. A POLL subscription should send a full update (initial sync) at the start of the subscription unless updates_only is set in the subscription. For a POLL subscription a full update is sent upon receiving the subscription and each subsequent POLL message. Each round of updates should also send a sync message according to 3.5.2.3.

"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."

@ostappus
Copy link

Thanks, @gcsl. I guess the issue can be resolved now.

@gcsl gcsl closed this as completed Aug 17, 2022
@iljatab
Copy link
Author

iljatab commented Aug 17, 2022 via email

@iljatab
Copy link
Author

iljatab commented Aug 17, 2022 via email

@gcsl
Copy link
Contributor

gcsl commented Aug 17, 2022

Apologies if this was unclear. Prior to the updates_only addition, the expectation was that a full update was sent for the initial subscription followed by sync, and for each subsequent POLL.

@gcsl
Copy link
Contributor

gcsl commented Aug 17, 2022

POLL is effectively a series of ONCE calls, but the RPC is persistent which allows a device to optimize any internal operations knowing that the same request is going to be repeated, thus eliminating overhead on subsequent requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants