namecoin / nmcontrol

Namecoin Control. This repo is deprecated in favor of https://github.com/namecoin/ncdns
136 stars 38 forks source link

pLoadconfig doesn't always have access to dependencies #88

Open JeremyRand opened 9 years ago

JeremyRand commented 9 years ago

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).
phelixbtc commented 9 years ago

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.

JeremyRand commented 9 years ago

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.

phelix commented 9 years ago

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