Skip to contentSkip to conversation

bitbake: runqueue: terminate build safely while RunQueueExecuteScenequeue init failed

PATCH In review Hongxu Jia 3 participants 5 messages Aug 27, 2014

lore
Share & tools
lore

Hongxu Jia

author
#0 lore raw

v2 cover bitbake: runqueue: terminate build safely while RunQueueExecuteScenequeue init failed

Changed in V2:
- Strip the commit message within 80 characters a line

//Hongxu

The following changes since commit 52b788c6df9201764130ab744bf67b770b24b896:

autogen-native: inherit pkgconfig to fix a build failure (2014-08-25 10:26:00 +0100)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib hongxu/bitbake
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=hongxu/bitbake

Hongxu Jia (1):
bitbake: runqueue: terminate build safely while
RunQueueExecuteScenequeue init failed

 bitbake/lib/bb/runqueue.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH v2 1/1 bitbake: runqueue: terminate build safely while RunQueueExecuteScenequeue init failed

While RunQueueExecuteScenequeue init failed, the exit of build is mess. Here is the example while bb.fatal invoked in RunQueueExecuteScenequeue:
...
Traceback (most recent call last):
| File "/home/jiahongxu/yocto/poky/bitbake/lib/bb/runqueue.py",
line 1824, in RunQueueExecuteScenequeue.__init__(rq=<bb.runqueue.RunQueue instance at 0x7f87dd7d5050>):
| locs = { "sq_fn" : sq_fn, "sq_task" : sq_taskname,
"sq_hash" : sq_hash, "sq_hashfn" : sq_hashfn, "d" : self.cooker.data }
| > valid = bb.utils.better_eval(call, locs)

|    def better_eval(source, locals):
|    >    return eval(source, get_context(), locals)
|  File "<string>", line 1, in <module>
|  File "/home/jiahongxu/yocto/poky/bitbake/lib/bb/__init__.py", line 102,
  in fatal:
|         logger.critical(''.join(args))
|    >    raise BBHandledException()

BBHandledException
...

We should terminate build safely while RunQueueExecuteScenequeue init failed.

---
 bitbake/lib/bb/runqueue.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
bitbake/lib/bb/runqueue.py +6 -1
index e13dc57..c7b1dc0 100644
@@ -1046,7 +1046,12 @@ class RunQueue:
                 self.state = runQueueComplete
             else:
                 self.start_worker()
-                self.rqexe = RunQueueExecuteScenequeue(self)
+                try:
+                    self.rqexe = RunQueueExecuteScenequeue(self)
+                except:
+                    # The RunQueueExecuteScenequeue init failure
+                    # terminated the build safely
+                    self.state = runQueueComplete
 
         if self.state in [runQueueSceneRun, runQueueRunning, runQueueCleanUp]:
             self.dm.check(self)
Signature · 1 line
1.9.1
#2 lore raw
Quoted 36 lines · Hongxu Jia

While RunQueueExecuteScenequeue init failed, the exit of build is mess. Here is the example while bb.fatal invoked in RunQueueExecuteScenequeue:
...
Traceback (most recent call last):
| File "/home/jiahongxu/yocto/poky/bitbake/lib/bb/runqueue.py",
line 1824, in RunQueueExecuteScenequeue.__init__(rq=<bb.runqueue.RunQueue instance at 0x7f87dd7d5050>):
| locs = { "sq_fn" : sq_fn, "sq_task" : sq_taskname,
"sq_hash" : sq_hash, "sq_hashfn" : sq_hashfn, "d" : self.cooker.data }
| > valid = bb.utils.better_eval(call, locs)

|    def better_eval(source, locals):
|    >    return eval(source, get_context(), locals)
|  File "<string>", line 1, in <module>
|  File "/home/jiahongxu/yocto/poky/bitbake/lib/bb/__init__.py", line 102,
  in fatal:
|         logger.critical(''.join(args))
|    >    raise BBHandledException()

BBHandledException
...

We should terminate build safely while RunQueueExecuteScenequeue init failed.

---
 bitbake/lib/bb/runqueue.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
bitbake/lib/bb/runqueue.py +0 -0
index e13dc57..c7b1dc0 100644
@@ -1046,7 +1046,12 @@ class RunQueue:
                 self.state = runQueueComplete

bitbake/lib/bb/runqueue.py class RunQueue: · line 1055

Quoted 10 lines
bitbake/lib/bb/runqueue.py +6 -1
             else:
                 self.start_worker()
-                self.rqexe = RunQueueExecuteScenequeue(self)
+                try:
+                    self.rqexe = RunQueueExecuteScenequeue(self)
+                except:
+                    # The RunQueueExecuteScenequeue init failure
+                    # terminated the build safely
+                    self.state = runQueueComplete
 

If the init fails, shouldn't we show a traceback and exit with an error status? Does this happen in a normal build and if so, is there an underlying cause we should fix?

I'm worried this would let errors go unnoticed. Except clauses in general should catch specific errors not every exception so this really can't merge in this form, sorry.

Cheers,

Richard

#4 lore raw
In reply to Hongxu Jia
Quoted 5 lines · Hongxu Jia

Changed in V2:
- Strip the commit message within 80 characters a line

//Hongxu

Quoted 8 lines

The following changes since commit 52b788c6df9201764130ab744bf67b770b24b896:

autogen-native: inherit pkgconfig to fix a build failure (2014-08-25 10:26:00 +0100)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib hongxu/bitbake
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=hongxu/bitbake

It would be nice to have patches for bitbake repository on bitbake-devel ML.

Quoted 15 lines

Hongxu Jia (1):
bitbake: runqueue: terminate build safely while
RunQueueExecuteScenequeue init failed

 bitbake/lib/bb/runqueue.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Signature · 7 lines
1.9.1

-- 
_______________________________________________
bitbake-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/bitbake-devel
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
author
#3 lore raw
In reply to Richard Purdie
Quoted 42 lines · Richard Purdie
Quoted 41 lines · Hongxu Jia

While RunQueueExecuteScenequeue init failed, the exit of build is mess. Here is the example while bb.fatal invoked in RunQueueExecuteScenequeue:
...
Traceback (most recent call last):
| File "/home/jiahongxu/yocto/poky/bitbake/lib/bb/runqueue.py",
line 1824, in RunQueueExecuteScenequeue.__init__(rq=<bb.runqueue.RunQueue instance at 0x7f87dd7d5050>):
| locs = { "sq_fn" : sq_fn, "sq_task" : sq_taskname,
"sq_hash" : sq_hash, "sq_hashfn" : sq_hashfn, "d" : self.cooker.data }
| > valid = bb.utils.better_eval(call, locs)

|    def better_eval(source, locals):
|    >    return eval(source, get_context(), locals)
|  File "<string>", line 1, in <module>
|  File "/home/jiahongxu/yocto/poky/bitbake/lib/bb/__init__.py", line 102,
   in fatal:
|         logger.critical(''.join(args))
|    >    raise BBHandledException()

BBHandledException
...

We should terminate build safely while RunQueueExecuteScenequeue init failed.

---
  bitbake/lib/bb/runqueue.py | 7 ++++++-
  1 file changed, 6 insertions(+), 1 deletion(-)
bitbake/lib/bb/runqueue.py +2 -1
index e13dc57..c7b1dc0 100644
@@ -1046,7 +1046,12 @@ class RunQueue:
                  self.state = runQueueComplete
              else:
                  self.start_worker()
-                self.rqexe = RunQueueExecuteScenequeue(self)
+                try:
+                    self.rqexe = RunQueueExecuteScenequeue(self)
Quoted 8 lines

bitbake/lib/bb/runqueue.py class RunQueue: · line 1055

Quoted 5 lines
bitbake/lib/bb/runqueue.py +4 -0
+                except:
+                    # The RunQueueExecuteScenequeue init failure
+                    # terminated the build safely
+                    self.state = runQueueComplete
 

If the init fails, shouldn't we show a traceback and exit with an error status? Does this happen in a normal build and if so, is there an underlying cause we should fix?

In my case, I want to catch the failure of self.rq.hashvalidate which invoked in RunQueueExecuteScenequeue, and exit in a normal build.

Quoted 4 lines

I'm worried this would let errors go unnoticed. Except clauses in general should catch specific errors not every exception so this really can't merge in this form, sorry.

Got it, I will add condition to catch the failure of self.rq.hashvalidate, and don't affect other errors.

Thanks,
//Hongxu

Quoted 5 lines

Cheers,

Richard