[Buildbot-devel] Ultimate fix for 'buildbot reconfig' problem

Ben Hearsum bhearsum at mozilla.com
Wed Mar 27 12:38:53 UTC 2013


I haven't seen this approach before, so forgive the potentially naive question but...

How does this work with multiple imports in the same file? The biggest reloading issue we have on the Mozilla Buildbot masters is multiple reloads of the same file.

For example, buildbotcustom.common is imported in at least two places:
https://github.com/mozilla/build-buildbotcustom/blob/master/misc.py#L23
https://github.com/mozilla/build-buildbotcustom/blob/master/process/factory.py#L19

but only reloaded in the former. If we reload the module in both of them we end up with dead references in the first after the second reload.

- Ben

On Wed, Mar 27, 2013 at 01:02:41AM +0200, Andrii Senkovych wrote:
> Hi,
> 
> Recently it was mentioned about how Mozilla solves the reconfig
> problem[1]. The same approach is used in metabuildbot configs[2].
> However there's a more clean and universal way of doing the same in
> just three lines of code for any number of imported modules. Behold:
> 
> from types import ModuleType
> x = ()
> _ = [reload(x) for x in locals() if isinstance(x, ModuleType)]
> 
> Some additional comments are available inside this[3] gist.
> 
>   [1]: http://hg.mozilla.org/build/buildbot-configs/file/a880563582c9/mozilla/scheduler_master.cfg
>   [2]: https://github.com/buildbot/metabbotcfg/blob/master/master.cfg
>   [3]: https://gist.github.com/jollyroger/5250060
> 
> ------------------------------------------------------------------------------
> Own the Future-Intel® Level Up Game Demo Contest 2013
> Rise to greatness in Intel's independent game demo contest.
> Compete for recognition, cash, and the chance to get your game 
> on Steam. $5K grand prize plus 10 genre and skill prizes. 
> Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
> _______________________________________________
> Buildbot-devel mailing list
> Buildbot-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/buildbot-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://buildbot.net/pipermail/devel/attachments/20130327/22461c38/attachment.bin>


More information about the devel mailing list