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

update_interface_state() is causing crashes and is probably fundamentally broken #10

Open
rhaberkorn opened this issue Jun 1, 2021 · 3 comments

Comments

@rhaberkorn
Copy link
Contributor

update_interface_state() for providing interfaces-state.interface... has a few problems.
At first, you should probably merge or pick this commit, as the setters are broken since 5ff31d9.

Secondly, the function is dispatching rpc_get_interface_state() synchronously while we almost always will be called by some libev dmconfig watcher deep down in the stacktrace. It is generally unsafe to mix synchronous and asynchronous dmconfig use. The synchronous call will do ev_run() on the default event loop, so all sorts of watchers could be run unexpectedly. Furthermore, even if we created a dedicated event loop, but reused the dmconfig connection to the config agent (eg. mand-cfgd), this could cause trouble as there might currently be traffic on that connection.
(In my case, it's causing crashes, although I haven't analyzed the exact chain of events.)

I'm unsure how to solve this. Perhaps all synchronous calls should be on their own event loop and the config agent should make sure that the "-state" role is registered on a dedicated dmconfig connection not used for anything else but answering rpc_get_interface_state().

@siicosmos
Copy link

Sorry, this is not related to your question: OpenCPE has not been updated for about 6-7 years. Is this project abandoned?

@rhaberkorn
Copy link
Contributor Author

Sorry, this is not related to your question: OpenCPE has not been updated for about 6-7 years. Is this project abandoned?

Seems to be pretty much dead, yes. However I'm using and keeping it up to date in this branch/fork: https://github.com/metratec/mand
The way we are using it is in no way connected to OpenCPE.

I am not aware of any other comparable open source device management database. dconf with some additional embedded patches might be a viable alternative if you are willing to go for the GNOME stack (or at least glib).

@rhaberkorn
Copy link
Contributor Author

Btw. I seem to have fixed the bug described here in f478a5b and 3354f34. In our config agent, I use a dedicated dmconfig session for state reporting to be on the safe side. The commit could probably be ported to mand-cfgd.

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

2 participants