-
Notifications
You must be signed in to change notification settings - Fork 11
Description
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().