summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/runqueue.py24
1 files changed, 19 insertions, 5 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 51d68a5cf8..3d8ae1f48b 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -984,8 +984,14 @@ class RunQueue:
984 self.state = runQueuePrepare 984 self.state = runQueuePrepare
985 985
986 # For disk space monitor 986 # For disk space monitor
987 # Invoked at regular time intervals via the bitbake heartbeat event
988 # while the build is running. We generate a unique name for the handler
989 # here, just in case that there ever is more than one RunQueue instance,
990 # start the handler when reaching runQueueSceneRun, and stop it when
991 # done with the build.
987 self.dm = monitordisk.diskMonitor(cfgData) 992 self.dm = monitordisk.diskMonitor(cfgData)
988 993 self.dm_event_handler_name = '_bb_diskmonitor_' + str(id(self))
994 self.dm_event_handler_registered = False
989 self.rqexe = None 995 self.rqexe = None
990 self.worker = {} 996 self.worker = {}
991 self.fakeworker = {} 997 self.fakeworker = {}
@@ -1208,10 +1214,12 @@ class RunQueue:
1208 self.rqdata.init_progress_reporter.next_stage() 1214 self.rqdata.init_progress_reporter.next_stage()
1209 self.rqexe = RunQueueExecuteScenequeue(self) 1215 self.rqexe = RunQueueExecuteScenequeue(self)
1210 1216
1211 if self.state in [runQueueSceneRun, runQueueRunning, runQueueCleanUp]:
1212 self.dm.check(self)
1213
1214 if self.state is runQueueSceneRun: 1217 if self.state is runQueueSceneRun:
1218 if not self.dm_event_handler_registered:
1219 res = bb.event.register(self.dm_event_handler_name,
1220 lambda x: self.dm.check(self) if self.state in [runQueueSceneRun, runQueueRunning, runQueueCleanUp] else False,
1221 ('bb.event.HeartbeatEvent',))
1222 self.dm_event_handler_registered = True
1215 retval = self.rqexe.execute() 1223 retval = self.rqexe.execute()
1216 1224
1217 if self.state is runQueueRunInit: 1225 if self.state is runQueueRunInit:
@@ -1230,7 +1238,13 @@ class RunQueue:
1230 if self.state is runQueueCleanUp: 1238 if self.state is runQueueCleanUp:
1231 retval = self.rqexe.finish() 1239 retval = self.rqexe.finish()
1232 1240
1233 if (self.state is runQueueComplete or self.state is runQueueFailed) and self.rqexe: 1241 build_done = self.state is runQueueComplete or self.state is runQueueFailed
1242
1243 if build_done and self.dm_event_handler_registered:
1244 bb.event.remove(self.dm_event_handler_name, None)
1245 self.dm_event_handler_registered = False
1246
1247 if build_done and self.rqexe:
1234 self.teardown_workers() 1248 self.teardown_workers()
1235 if self.rqexe.stats.failed: 1249 if self.rqexe.stats.failed:
1236 logger.info("Tasks Summary: Attempted %d tasks of which %d didn't need to be rerun and %d failed.", self.rqexe.stats.completed + self.rqexe.stats.failed, self.rqexe.stats.skipped, self.rqexe.stats.failed) 1250 logger.info("Tasks Summary: Attempted %d tasks of which %d didn't need to be rerun and %d failed.", self.rqexe.stats.completed + self.rqexe.stats.failed, self.rqexe.stats.skipped, self.rqexe.stats.failed)