Skip to content
New issue

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

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

Already on GitHub? # to your account

Netopeer2 does not handle concurrent gets #1685

Open
trentzhou opened this issue Dec 19, 2024 · 3 comments
Open

Netopeer2 does not handle concurrent gets #1685

trentzhou opened this issue Dec 19, 2024 · 3 comments
Labels
is:enhancement Request for adding new feature or enahncing functionality.

Comments

@trentzhou
Copy link

This is a follow question of sysrepo/sysrepo#3481.

For example, I have two netconf sessions.

Session A calls get /status/firewall/stats. This is a slow operation which may take a few seconds. The results is collected by a background task.
Session B calls get /status/uptime. This is a very quick operation which could be handled immediately.

Originally the two xpaths are handled by the same subscription. I changed the code to two subscriptions, in my test, session B still has to wait until session A finishes the get.

The behavior is caused by the design of netopeer2:
image

The netconf request gets to netopeer, then function np2srv_rpc_cb is called. It calls sr_rpc_send_tree to invoke the rpc. This <get> request is then handled by the subscription thread. This subscription is locked. This prevents any new netconf requests.

Can np2srv_rpc_cb call np2srv_rpc_get_cb directly? I did a quick hack, both sessions can work concurrently with this change.

@michalvasko
Copy link
Member

I actually have this change in TODO but had not got to it yet. However, there is a requirement for NETCONF pipelining so I am not sure the change you made would not cause a deviation from the standard.

@michalvasko michalvasko added the is:enhancement Request for adding new feature or enahncing functionality. label Dec 19, 2024
@trentzhou
Copy link
Author

trentzhou commented Dec 19, 2024

Thanks @michalvasko for your quick response.

The RFC document https://datatracker.ietf.org/doc/html/rfc6241#section-4.5 did not say how different sessions should work.

I found this discussion on tail-f site: https://discuss.tail-f.com/t/pipelining-versus-netconf-session/3675. It seems confd can handle concurrent get requests.

@trentzhou trentzhou changed the title Netopeer2 does not current concurrent gets Netopeer2 does not handle concurrent gets Dec 19, 2024
@michalvasko
Copy link
Member

Okay, then like I said, it should be implemented at some point next year.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
is:enhancement Request for adding new feature or enahncing functionality.
Projects
None yet
Development

No branches or pull requests

2 participants