[NETCONF-351] Websocket implementation doesn't support unsubscribe for notifications Created: 23/Feb/17  Updated: 04/May/20

Status: Confirmed
Project: netconf
Component/s: restconf-nb
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Medium
Reporter: Ritu Sood Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issue Links:
Duplicate
is duplicated by NETCONF-409 Existing Websocket notifications miss... Resolved
External issue ID: 7845

 Description   

Current websocket mechanism has support for subscription for notifications but doesn't support unsubscribe for notifications.
This is required in re-connection scenarios for example if there is a socket disconnection due to any reason.
Current behavior of websocket implementation is that on the first connect of the websocket client, all the events present up to that point are sent as a create operation notifications. Subsequent re-connections do not result in notifications for those events. This will cause losing of events during the time of disconnection.
To insure no event lose client should be able to "unsubscribe" for notifications and then re-subscribe and in that case all the events will be received again.



 Comments   
Comment by Ivan Hrasko [ 28/Feb/17 ]

Do you use this setup https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL:Restconf:Change_event_notification_subscription ?

Comment by Robert Varga [ 01/Jun/17 ]

What we need to do here is to expose a new RPC to destroy a dynamically created notification stream. The RPC should live in sal-restconf-connector/src/main/yang/opendaylight-md-sal-remote.yang and should tear down the stream and its listener.

Comment by Robert Varga [ 01/Jun/17 ]

Another, possibly better alternative is to split the act of defining the notification stream and the act of subscribing the stream.

From requirements perspective it is completely fine to create-data-change-event-subscription to just set up a blank stream (which does not actually listen for data, but knows that the instance identifier is) and then start a dedicated DataTreeChangeListener when a websocket request to listen comes in – hence each websocket client will have its own DataTreeChangeListener.

This also means that such a stream does not have the RFC5277 replaySupport capability (e.g. replaySupport is always false).

As for lifecycle interactions, if a stream gets destroyed, we want all existing clients to finish delivering their current notification and then disconnect them. This maps to destroying the DataTreeChangeListener once it has finished whatever its current sending to the websocket.

Generated at Wed Feb 07 20:14:47 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.