Comments (6)
Is it expected to change sid everytime or is there a problem with implementation or our coding?
SID changes because callbacks get temporary sessions existing only for the duration of the callback.
How can a subscription be uniquely identifiable among several sessions and connections?
Every subscription has a unique sub_id
, which is also passed to the callbacks.
Is the nc_session ID and sid refer to the same data or nc_session is just for the server-client connection?
Every NETCONF session has a dedicated sysrepo session but that is an internal implementation detail that can change (it was not always like this). You cannot get to the sysrepo session anyway.
If the entire server-client connection closes and a new session opens for each rpc by netopeer2-cli. How can we identify the connection from a given user?
If the connection is terminated and restored, it is a new connection (session) and is not related to the previous one in any way so you cannot really match them. Or did I misunderstand your question?
from sysrepo.
Thank you Michal,
To be more clear, we have a development environment on local computer, which includes;
- All required libraries installed (sysrepo "7.19.3", libyang "2.38.14", libnetconf2 "3.6.1", netopeer2 "2.1.71")
- A netopeer2-server running on console
- A netopeer2-cli running on console
- Developing sysrepo-plugin application on the C development IDE*
*sub_id
values are observed from the IDE.
When we try to use sub_id
as an identifier for o-ran-supervision subscription on the supervision-notification by using;
subscribe --stream o-ran-supervision
Client subscription request get sub_id
of 61. After a while, from the same client session on netopeer2-cli, following RPC is send;
user-rpc --rpc-timeout 9999
and callback function on the netopeer2-server side get sub_id
of 62.
Similarly, first client command (subscribe) has session ID of sid=81
and the second command (user-rpc) has a session ID of sid=83
. So that each rpc has own session ID and sub_id
, which are sequentially incremented by 1 or more if any further session or subscription appeared in the background.
We are expecting each unique subscription to have the same sub_id
, but what we see sub_id
is changing for the same subscription.
We are trying to distinguish user-rpcs from each other so that we can manage counters for watchdog-reset timers belonging to different subscriptions.
Given identifiers (session ID, sid
and sub_id
) are changing, is there any other way to match incoming user-rpcs with their subscriptions on the netopeer2-server side?
Thank you,
mustafa
from sysrepo.
We are expecting each unique subscription to have the same sub_id, but what we see sub_id is changing for the same subscription.
What is a subscription? You are using it in a really confusing way and I have no idea what you mean. What I assumed is that a subscription is a notification subscription created by a client, using subscribe
command in the CLI, for example. If you then send a user-rpc
, it has nothing to do with any subscription, you have simply sent another RPC on the NETCONF session. So you may want to clarify what you are trying to do, match all the RPCs of a NETCONF session?
from sysrepo.
What I assumed is that a subscription is a notification subscription created by a client, using subscribe command in the CLI
We are exactly doing this.
If you then send a user-rpc, it has nothing to do with any subscription, you have simply sent another RPC on the NETCONF session
We assumed that for a given NETCONF connection, which are created by;
$ netopeer2-cli
> connect
> status
has an unique identifier in order to be used on the netopeer2-server side.
Now it is clear that each rpc has its own session and sub_id values. We need to distinguish multiple client and their user rpcs on the netopeer2-server side.
Each client has its own watchdog timers on the netopeer2-server side. Depending on the user rpcs coming from the clients, only the corresponding timers should be set/reset on the netopeer2-server.
Therefore, is there a way to identify the owner (client) of the user-rpcs on the netopeer2-server side?
from sysrepo.
Okay, I think I understand now although you are still using some ambiguous terms. Every NETCONF client has its own NETCONF session ID, you can read it in every callback using sr_session_get_orig_data()
.
from sysrepo.
Thank you Michal, sr_session_get_orig_data()
is worked for me.
from sysrepo.
Related Issues (20)
- Unnecessary subscriptions triggered when writing in operational datastore HOT 6
- Changes applying order during commit request after edit-config to candidate broken when request contains changes for a few modules HOT 14
- Error when setting a value multiple times HOT 1
- Request for one last git tag on libyang1 branch HOT 2
- [ERR] Datastore plugin "JSON notif" not found HOT 8
- sr_shmmod_lock: Interrupted system call HOT 2
- sr_get_items crashes in libyang (lyd_lyb_data_length) HOT 3
- [ERR] JSON DS file: Retrieving GID "0" grp entry failed (No such file or directory) [ERR] Callback "init" of plugin "JSON DS file" for module "ietf netconf acm" failed HOT 5
- sr_get_items retrieve data elements that are not in the datastore. HOT 1
- Can we use APIs based on sr_val_t HOT 1
- ietf-factory-reset does not trigger module change callback HOT 1
- ThreadSanitizer: unlock of an unlocked mutex in `test_copy_config`'s `test_simple` HOT 4
- Callback "load" of plugin "JSON DS file" for module "name of the module" HOT 2
- edit-config parameter xml file invalid. HOT 3
- Merge functionality with sysrepocfg in devel HOT 1
- Recursive reader limit 255 reached HOT 2
- Detecting a close-session RPC HOT 2
- Malformed data in operational module, a huge sequence of `{"sysrepo:dup-inst-list-position":[null],"ietf-netconf:operation":"merge"}` HOT 5
- Action in augment: "Failed to send RPC" HOT 3
- Detecting subscription expiration HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sysrepo.