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

session: fix rpc_send_ly dnode free function #60

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

samuel-gauthier
Copy link
Collaborator

When rpc_send_ly is called more that 255 times in the same session, it fails, because the context lock has been acquired too many times.

The new_dnode function can not be used for rpc_send_ly because it does not free the output node, it only frees output.tree. Use a mechanism similar to get_data_ly, i.e free the output node returned by sr_rpc_send_tree, call sr_release_data on it as well, and release the context that was used by our new dnode.

When rpc_send_ly is called more that 255 times in the same session, it
fails, because the context has been acquired too many times.

The new_dnode function can not be used for rpc_send_ly because it does
not free the output node, it only frees output.tree. Use a mechanism
similar to get_data_ly, i.e free the output node returned by
sr_rpc_send_tree, call sr_release_data on it as well, and release the
context that was used by our new dnode.

Signed-off-by: Samuel Gauthier <samuel.gauthier@6wind.com>
Copy link
Collaborator

@rjarry rjarry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, Samuel!

@rjarry rjarry merged commit 77bc35d into sysrepo:master Feb 1, 2024
11 checks passed
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

Successfully merging this pull request may close these issues.

2 participants