[bitbake-devel] [PATCH 2/4] runqueue.py: monitor disk space at regular time intervals

Patrick Ohly patrick.ohly at intel.com
Mon Nov 28 16:30:13 UTC 2016


On Mon, 2016-11-28 at 15:58 +0000, Richard Purdie wrote:
> On Mon, 2016-11-28 at 16:15 +0100, Patrick Ohly wrote:
> >          # For disk space monitor
> > +        # Invoked at regular time intervals via the bitbake
> > heartbeat event
> > +        # while the build is running.
> >          self.dm = monitordisk.diskMonitor(cfgData)
> > +        bb.event.register('_bb_diskmonitor',
> > +                          lambda x: self.dm.check(self) if
> > self.state in [runQueueSceneRun, runQueueRunning, runQueueCleanUp]
> > else False,
> > +                          ('bb.event.HeartbeatEvent',))
> >  
[...]
> Don't we have to unregister this at some point too? Cooker can persist
> across multiple builds (although its not the default).

Indeed, that case will need further work. I hadn't considered that. What
would be a good point to unregister the event handler? Perhaps the
cleanup code after "if (self.state is runQueueComplete or self.state is
runQueueFailed) and self.rqexe" in _execute_runqueue()?

Just for my understanding, is there guaranteed to be only one RunQueue
instance in the cooker process or could there be more than one at the
same time? Can there be more than one event handler with the same name
(the first parameter of bb.event.register)?

Is the non-default case the memory-resident bitbake?

The buildstats.py code I posted for OE-core has a similar issue. It
assumes that files can be opened when the class gets instantiated and
kept open as long as the process runs.

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.






More information about the bitbake-devel mailing list