[OE-core] [PATCH] cooker: release lockfile on process exit

Lucas Dutra Nunes ldnunes at ossystems.com.br
Tue May 19 14:14:28 UTC 2015


This fixes problems caused by the bitbake process exiting without
releasing the lockfile. This is most apparent while running scripts that
call bitbake several times, like the "cleanup-workdir" script on
oe-core.

Signed-off-by: Lucas Dutra Nunes <ldnunes at ossystems.com.br>
---
 lib/bb/cooker.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index ddf5fed..627ad4a 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -40,6 +40,7 @@ import Queue
 import signal
 import prserv.serv
 import pyinotify
+import atexit
 
 logger      = logging.getLogger("BitBake")
 collectlog  = logging.getLogger("BitBake.Collection")
@@ -164,6 +165,9 @@ class BBCooker:
         except:
             pass
 
+        # Register the unlocking of the file at exit:
+        atexit.register(bb.utils.unlockfile, self.lock)
+
         # TOSTOP must not be set or our children will hang when they output
         fd = sys.stdout.fileno()
         if os.isatty(fd):
-- 
2.1.4




More information about the Openembedded-core mailing list