nmcontrol icon indicating copy to clipboard operation
nmcontrol copied to clipboard

pLoadconfig doesn't always have access to dependencies

Open JeremyRand opened this issue 9 years ago • 3 comments

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).

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/23086219-ploadconfig-doesn-t-always-have-access-to-dependencies?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github).

JeremyRand avatar Jun 26 '15 07:06 JeremyRand

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.

phelixbtc avatar Jun 26 '15 07:06 phelixbtc

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 avatar Jul 18 '15 01:07 JeremyRand

@JeremyRand Yeah, fine with me. Also feel free to add comments to the plugin start system.

phelix avatar Jul 18 '15 12:07 phelix