All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] V3: hob check disk size
@ 2012-07-27  8:38 Kang Kai
  2012-07-27  8:38 ` [PATCH 1/2] monitordisk: fire event DISKFULL when terminate build Kang Kai
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Kang Kai @ 2012-07-27  8:38 UTC (permalink / raw)
  To: richard.purdie; +Cc: bitbake-devel, Zhenfeng.Zhao

Hi Richard,

In V3 I fire the event DiskFull in diskMonitor.check() as your commented.

Thanks,
Kai

The following changes since commit 0ffb02eec2beaea27ff0ec9d3d31b0a09e675a4c:

  documentation: Updated the h6 style to use a larger font (2012-07-24 10:35:34 +0100)

are available in the git repository at:
  git://git.pokylinux.org/poky-contrib kangkai/hob-check-size
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=kangkai/hob-check-size

Kang Kai (2):
  monitordisk: fire event DISKFULL when terminate build
  hob: deal event DiskFull

 bitbake/lib/bb/event.py                  |    8 ++++++++
 bitbake/lib/bb/monitordisk.py            |    5 +++++
 bitbake/lib/bb/ui/crumbs/builder.py      |    4 ++++
 bitbake/lib/bb/ui/crumbs/runningbuild.py |   11 ++++++++++-
 4 files changed, 27 insertions(+), 1 deletions(-)

-- 
1.7.5.4




^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] monitordisk: fire event DISKFULL when terminate build
  2012-07-27  8:38 [PATCH 0/2] V3: hob check disk size Kang Kai
@ 2012-07-27  8:38 ` Kang Kai
  2012-07-27  8:38 ` [PATCH 2/2] hob: deal event DiskFull Kang Kai
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Kang Kai @ 2012-07-27  8:38 UTC (permalink / raw)
  To: richard.purdie; +Cc: bitbake-devel, Zhenfeng.Zhao

Part of [Yocto #2168]

Add a event DiskFull to descript the termination by disk monitor.

Update check() to fire the event DiskFull when terminates the build.
This could help UIs to deal this scenario and show more information to
end user.

Signed-off-by: Kang Kai <kai.kang@windriver.com>
---
 bitbake/lib/bb/event.py       |    8 ++++++++
 bitbake/lib/bb/monitordisk.py |    5 +++++
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py
index 1116c0a..20923b5 100644
--- a/bitbake/lib/bb/event.py
+++ b/bitbake/lib/bb/event.py
@@ -312,6 +312,14 @@ class BuildCompleted(BuildBase, OperationCompleted):
             OperationCompleted.__init__(self, total, "Building Failed")
         BuildBase.__init__(self, n, p, failures)
 
+class DiskFull(Event):
+    """Disk full case build aborted"""
+    def __init__(self, dev, type, freespace, mountpoint):
+        Event.__init__(self)
+        self._dev = dev
+        self._type = type
+        self._free = freespace
+        self._mountpoint = mountpoint
 
 class NoProvider(Event):
     """No Provider for an Event"""
diff --git a/bitbake/lib/bb/monitordisk.py b/bitbake/lib/bb/monitordisk.py
index 9469193..2bd4881 100644
--- a/bitbake/lib/bb/monitordisk.py
+++ b/bitbake/lib/bb/monitordisk.py
@@ -176,6 +176,7 @@ class diskMonitor:
     def __init__(self, configuration):
 
         self.enableMonitor = False
+        self.configuration = configuration
 
         BBDirs = configuration.getVar("BB_DISKMON_DIRS", True) or None
         if BBDirs:
@@ -219,10 +220,12 @@ class diskMonitor:
                         logger.error("No new tasks can be excuted since the disk space monitor action is \"STOPTASKS\"!")
                         self.checked[dev] = True
                         rq.finish_runqueue(False)
+                        bb.event.fire(bb.event.DiskFull(dev, 'disk', freeSpace, self.devDict[dev][1]), self.configuration)
                     elif self.devDict[dev][0] == "ABORT" and not self.checked[dev]:
                         logger.error("Immediately abort since the disk space monitor action is \"ABORT\"!")
                         self.checked[dev] = True
                         rq.finish_runqueue(True)
+                        bb.event.fire(bb.event.DiskFull(dev, 'disk', freeSpace, self.devDict[dev][1]), self.configuration)
 
                 # The free inodes, float point number
                 freeInode = st.f_favail
@@ -237,8 +240,10 @@ class diskMonitor:
                         logger.error("No new tasks can be excuted since the disk space monitor action is \"STOPTASKS\"!")
                         self.checked[dev] = True
                         rq.finish_runqueue(False)
+                        bb.event.fire(bb.event.DiskFull(dev, 'inode', freeSpace, self.devDict[dev][1]), self.configuration)
                     elif self.devDict[dev][0]  == "ABORT" and not self.checked[dev]:
                         logger.error("Immediately abort since the disk space monitor action is \"ABORT\"!")
                         self.checked[dev] = True
                         rq.finish_runqueue(True)
+                        bb.event.fire(bb.event.DiskFull(dev, 'inode', freeSpace, self.devDict[dev][1]), self.configuration)
         return
-- 
1.7.5.4




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] hob: deal event DiskFull
  2012-07-27  8:38 [PATCH 0/2] V3: hob check disk size Kang Kai
  2012-07-27  8:38 ` [PATCH 1/2] monitordisk: fire event DISKFULL when terminate build Kang Kai
@ 2012-07-27  8:38 ` Kang Kai
  2012-08-01  2:00 ` [PATCH 0/2] V3: hob check disk size Kang Kai
  2012-08-02 14:26 ` Richard Purdie
  3 siblings, 0 replies; 5+ messages in thread
From: Kang Kai @ 2012-07-27  8:38 UTC (permalink / raw)
  To: richard.purdie; +Cc: bitbake-devel, Zhenfeng.Zhao

Part of [Yocto #2168]

When bitbake runqueue is teminated by disk monitor, it will send event
DiskFull. Update to handle it.

Signed-off-by: Kang Kai <kai.kang@windriver.com>
---
 bitbake/lib/bb/ui/crumbs/builder.py      |    4 ++++
 bitbake/lib/bb/ui/crumbs/runningbuild.py |   11 ++++++++++-
 2 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index 123608e..c2e7068 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -430,6 +430,7 @@ class Builder(gtk.Window):
         self.handler.build.connect("build-started",      self.handler_build_started_cb)
         self.handler.build.connect("build-succeeded",    self.handler_build_succeeded_cb)
         self.handler.build.connect("build-failed",       self.handler_build_failed_cb)
+        self.handler.build.connect("build-aborted",      self.handler_build_aborted_cb)
         self.handler.build.connect("task-started",       self.handler_task_started_cb)
         self.handler.build.connect("log-error",          self.handler_build_failure_cb)
         self.handler.build.connect("no-provider",        self.handler_no_provider_cb)
@@ -920,6 +921,9 @@ class Builder(gtk.Window):
     def handler_build_failed_cb(self, running_build):
         self.build_failed()
 
+    def handler_build_aborted_cb(self, running_build):
+        self.build_failed()
+
     def handler_no_provider_cb(self, running_build, msg):
         dialog = CrumbsMessageDialog(self, Builder.interpret_markup(msg), gtk.STOCK_DIALOG_INFO)
         button = dialog.add_button("Close", gtk.RESPONSE_OK)
diff --git a/bitbake/lib/bb/ui/crumbs/runningbuild.py b/bitbake/lib/bb/ui/crumbs/runningbuild.py
index 8cf36ee..0347058 100644
--- a/bitbake/lib/bb/ui/crumbs/runningbuild.py
+++ b/bitbake/lib/bb/ui/crumbs/runningbuild.py
@@ -76,6 +76,9 @@ class RunningBuild (gobject.GObject):
           'build-complete'  :  (gobject.SIGNAL_RUN_LAST,
                                 gobject.TYPE_NONE,
                                ()),
+          'build-aborted'     :  (gobject.SIGNAL_RUN_LAST,
+                                gobject.TYPE_NONE,
+                               ()),
           'task-started'    :  (gobject.SIGNAL_RUN_LAST,
                                 gobject.TYPE_NONE,
                                (gobject.TYPE_PYOBJECT,)),
@@ -93,6 +96,7 @@ class RunningBuild (gobject.GObject):
         gobject.GObject.__init__ (self)
         self.model = RunningBuildModel()
         self.sequential = sequential
+        self.buildaborted = False
 
     def reset (self):
         self.pids_to_task.clear()
@@ -274,7 +278,9 @@ class RunningBuild (gobject.GObject):
                                       0))
 
             # Emit the appropriate signal depending on the number of failures
-            if (failures >= 1):
+            if self.buildaborted:
+                self.emit ("build-aborted")
+            elif (failures >= 1):
                 self.emit ("build-failed")
             else:
                 self.emit ("build-succeeded")
@@ -286,6 +292,9 @@ class RunningBuild (gobject.GObject):
             if pbar:
                 pbar.set_text(event.msg)
 
+        elif isinstance(event, bb.event.DiskFull):
+            self.buildaborted = True
+
         elif isinstance(event, bb.command.CommandFailed):
             if event.error.startswith("Exited with"):
                 # If the command fails with an exit code we're done, emit the
-- 
1.7.5.4




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] V3: hob check disk size
  2012-07-27  8:38 [PATCH 0/2] V3: hob check disk size Kang Kai
  2012-07-27  8:38 ` [PATCH 1/2] monitordisk: fire event DISKFULL when terminate build Kang Kai
  2012-07-27  8:38 ` [PATCH 2/2] hob: deal event DiskFull Kang Kai
@ 2012-08-01  2:00 ` Kang Kai
  2012-08-02 14:26 ` Richard Purdie
  3 siblings, 0 replies; 5+ messages in thread
From: Kang Kai @ 2012-08-01  2:00 UTC (permalink / raw)
  To: Kang Kai; +Cc: bitbake-devel, Zhenfeng.Zhao

On 2012年07月27日 16:38, Kang Kai wrote:
> Hi Richard,
>
> In V3 I fire the event DiskFull in diskMonitor.check() as your commented.

Hi Richard,

Would you like to help me to review these patches?
Thanks,

Kai

> Thanks,
> Kai
>
> The following changes since commit 0ffb02eec2beaea27ff0ec9d3d31b0a09e675a4c:
>
>    documentation: Updated the h6 style to use a larger font (2012-07-24 10:35:34 +0100)
>
> are available in the git repository at:
>    git://git.pokylinux.org/poky-contrib kangkai/hob-check-size
>    http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=kangkai/hob-check-size
>
> Kang Kai (2):
>    monitordisk: fire event DISKFULL when terminate build
>    hob: deal event DiskFull
>
>   bitbake/lib/bb/event.py                  |    8 ++++++++
>   bitbake/lib/bb/monitordisk.py            |    5 +++++
>   bitbake/lib/bb/ui/crumbs/builder.py      |    4 ++++
>   bitbake/lib/bb/ui/crumbs/runningbuild.py |   11 ++++++++++-
>   4 files changed, 27 insertions(+), 1 deletions(-)
>




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] V3: hob check disk size
  2012-07-27  8:38 [PATCH 0/2] V3: hob check disk size Kang Kai
                   ` (2 preceding siblings ...)
  2012-08-01  2:00 ` [PATCH 0/2] V3: hob check disk size Kang Kai
@ 2012-08-02 14:26 ` Richard Purdie
  3 siblings, 0 replies; 5+ messages in thread
From: Richard Purdie @ 2012-08-02 14:26 UTC (permalink / raw)
  To: Kang Kai; +Cc: bitbake-devel, Zhenfeng.Zhao

On Fri, 2012-07-27 at 16:38 +0800, Kang Kai wrote:
> Hi Richard,
> 
> In V3 I fire the event DiskFull in diskMonitor.check() as your commented.
> 
> Thanks,
> Kai
> 
> The following changes since commit 0ffb02eec2beaea27ff0ec9d3d31b0a09e675a4c:
> 
>   documentation: Updated the h6 style to use a larger font (2012-07-24 10:35:34 +0100)
> 
> are available in the git repository at:
>   git://git.pokylinux.org/poky-contrib kangkai/hob-check-size
>   http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=kangkai/hob-check-size
> 
> Kang Kai (2):
>   monitordisk: fire event DISKFULL when terminate build
>   hob: deal event DiskFull

Looks much cleaner, thanks for the changes. Merged to master, thanks.

Richard




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-08-02 14:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-27  8:38 [PATCH 0/2] V3: hob check disk size Kang Kai
2012-07-27  8:38 ` [PATCH 1/2] monitordisk: fire event DISKFULL when terminate build Kang Kai
2012-07-27  8:38 ` [PATCH 2/2] hob: deal event DiskFull Kang Kai
2012-08-01  2:00 ` [PATCH 0/2] V3: hob check disk size Kang Kai
2012-08-02 14:26 ` Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.