[oe-commits] [openembedded-core] 02/07: lib/oe/utils: Fix hang in multiprocess_launch()

git at git.openembedded.org git at git.openembedded.org
Sat Feb 16 15:04:26 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 4c728afa0e78ee50271d167937614c7d45cb8734
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Sat Feb 16 14:01:56 2019 +0000

    lib/oe/utils: Fix hang in multiprocess_launch()
    
    If large results values are returned by the subprocesses, we can hit a deadlock
    where the subprocess is trying to write data back to the parent, the pipe is full
    and the parent is waiting for the child to exit.
    
    Avoid this by calling the update() method which would trigger reading a result
    from the child, avoiding the deadlock. The issue is described in
    https://bugs.python.org/issue8426
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/lib/oe/utils.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
index 0c1d48a..3a49609 100644
--- a/meta/lib/oe/utils.py
+++ b/meta/lib/oe/utils.py
@@ -307,6 +307,10 @@ def multiprocess_launch(target, items, d, extraargs=None):
             p.start()
             launched.append(p)
         for q in launched:
+            # Have to manually call update() to avoid deadlocks. The pipe can be full and
+            # transfer stalled until we try and read the results object but the subprocess won't exit
+            # as it still has data to write (https://bugs.python.org/issue8426)
+            q.update()
             # The finished processes are joined when calling is_alive()
             if not q.is_alive():
                 if q.exception:

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list