From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 2/7] lib/oe/utils: Fix hang in multiprocess_launch()
Date: Sat, 16 Feb 2019 21:46:33 +0000 [thread overview]
Message-ID: <20190216214638.11456-2-richard.purdie@linuxfoundation.org> (raw)
In-Reply-To: <20190216214638.11456-1-richard.purdie@linuxfoundation.org>
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@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 0c1d48a209e..3a496090f3a 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:
--
2.20.1
next prev parent reply other threads:[~2019-02-16 21:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-16 21:46 [PATCH 1/7] package: Rework debug source file handling Richard Purdie
2019-02-16 21:46 ` Richard Purdie [this message]
2019-02-16 21:46 ` [PATCH 3/7] quilt-native: Remove RDEPENDS on util-linux-native Richard Purdie
2019-02-16 21:46 ` [PATCH 4/7] glib-2.0-native: Break circular dependency on shared-mime-utils Richard Purdie
2019-02-16 22:45 ` Peter Kjellerstedt
2019-02-17 8:52 ` Richard Purdie
2019-02-16 21:46 ` [PATCH 5/7] font-util: Break circular native RDEPENDS Richard Purdie
2019-02-16 22:48 ` Peter Kjellerstedt
2019-02-16 21:46 ` [PATCH 6/7] native: Enable RDEPENDS handling Richard Purdie
2019-02-17 10:18 ` Richard Purdie
2019-02-16 21:46 ` [PATCH 7/7] quilt: Merge recipe files into a more coherent form Richard Purdie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190216214638.11456-2-richard.purdie@linuxfoundation.org \
--to=richard.purdie@linuxfoundation.org \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox