All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cooker: release lockfile on process exit
@ 2015-05-19 14:14 Lucas Dutra Nunes
  2015-05-19 21:07 ` Richard Purdie
  0 siblings, 1 reply; 4+ messages in thread
From: Lucas Dutra Nunes @ 2015-05-19 14:14 UTC (permalink / raw)
  To: bitbake-devel-request; +Cc: clarson, openembedded-core

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@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



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

end of thread, other threads:[~2015-05-20 12:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-19 14:14 [PATCH] cooker: release lockfile on process exit Lucas Dutra Nunes
2015-05-19 21:07 ` Richard Purdie
2015-05-19 21:24   ` Otavio Salvador
2015-05-20 12:11     ` 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.