nmcontrol
nmcontrol copied to clipboard
pLoadconfig doesn't always have access to dependencies
The pLoadconfig method of plugins doesn't have access to all of the plugin's dependencies when the plugin first starts. This causes a nasty race condition where a plugin can fail to be initialized if its dependencies haven't started already. pluginNamespaceDomain is erroring for me because of this (its pLoadconfig method tries to access the "dns" plugin).
I have run into this issue once before. We then solved it via the criticalStartException (see nmcontrol.py) but maybe we need an early and a late start. The current way is quite confusing anyway, maybe we can also make things a bit clearer.
So, I'm actually not seeing why pluginNamespaceDomain even needs to access the "dns" plugin as part of pLoadconfig. The code in question looks like it would make more sense in pStart.
@phelix Is it okay if I submit a PR that moves that code to pStart? I think that will fix that particular instance of this issue.
@JeremyRand Yeah, fine with me. Also feel free to add comments to the plugin start system.