Openembedded Core Discussions
 help / color / mirror / Atom feed
From: "Aníbal Limón" <anibal.limon@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Cc: joshua.g.lock@intel.com, clarson@kergoth.com
Subject: [PATCH] classes/sstate.bbclass: Enable thread lock when checkstatus
Date: Tue,  4 Oct 2016 11:45:53 -0500	[thread overview]
Message-ID: <1475599553-21057-1-git-send-email-anibal.limon@linux.intel.com> (raw)

The checkstatus function fires an event to notify bitbake UI about
the progress of the task, this function is implemented using ThreadPool
and is causing event lose when multiple threads tries to fire an event
(writes over socket/fd).

[YOCTO #10330]

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
---
 meta/classes/sstate.bbclass | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 6f0c791..172384b 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -851,15 +851,19 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=False):
 
         if tasklist:
             bb.event.fire(bb.event.ProcessStarted("Checking sstate mirror object availability", len(tasklist)), d)
+
             import multiprocessing
             nproc = min(multiprocessing.cpu_count(), len(tasklist))
 
+            bb.event.enable_threadlock()
             pool = oe.utils.ThreadedPool(nproc, len(tasklist),
                     worker_init=checkstatus_init, worker_end=checkstatus_end)
             for t in tasklist:
                 pool.add_task(checkstatus, t)
             pool.start()
             pool.wait_completion()
+            bb.event.disable_threadlock()
+
             bb.event.fire(bb.event.ProcessFinished("Checking sstate mirror object availability"), d)
             if whitelist and missing:
                 bb.fatal('Required artifacts were unavailable - exiting')
-- 
2.1.4



             reply	other threads:[~2016-10-04 16:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-04 16:45 Aníbal Limón [this message]
2016-10-04 16:46 ` [PATCH] classes/sstate.bbclass: Enable thread lock when checkstatus Aníbal Limón

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=1475599553-21057-1-git-send-email-anibal.limon@linux.intel.com \
    --to=anibal.limon@linux.intel.com \
    --cc=clarson@kergoth.com \
    --cc=joshua.g.lock@intel.com \
    --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