diff options
author | Enrico Scholz <enrico.scholz@sigma-chemnitz.de> | 2022-11-19 11:39:25 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-11-22 12:26:42 +0000 |
commit | eacd52216815e0c75e5f257b6db792afd8b1b6df (patch) | |
tree | 8bd842baa173cb13a9f15d8a897ecd9ed5186e0e | |
parent | 1a418b35918abf78f18356fd77c63c94a14065ef (diff) | |
download | openembedded-core-contrib-eacd52216815e0c75e5f257b6db792afd8b1b6df.tar.gz |
sstate: show progress bar again
Transition to ThreadPoolExecutor (eb6a6820928472ef194b963b606454e731f9486f)
broke the
| Checking sstate mirror object availability: ...
progress bar because the removed 'thread_worker' was still referenced
in an asynchronous function. As the result of the future is never
read, the resulting backtrace is silently discarded.
Replace the information given to 'ProcessProgress' by a counter.
Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-rw-r--r-- | meta/classes-global/sstate.bbclass | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/meta/classes-global/sstate.bbclass b/meta/classes-global/sstate.bbclass index 21959ff13b..77e3ea34e1 100644 --- a/meta/classes-global/sstate.bbclass +++ b/meta/classes-global/sstate.bbclass @@ -925,6 +925,8 @@ sstate_unpack_package () { BB_HASHCHECK_FUNCTION = "sstate_checkhashes" def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True, **kwargs): + import itertools + found = set() missed = set() @@ -1019,7 +1021,7 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True, connection_cache_pool.put(connection_cache) if progress: - bb.event.fire(bb.event.ProcessProgress(msg, len(tasklist) - thread_worker.tasks.qsize()), d) + bb.event.fire(bb.event.ProcessProgress(msg, next(cnt_tasks_done)), d) tasklist = [] for tid in missed: @@ -1029,6 +1031,8 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True, if tasklist: nproc = min(int(d.getVar("BB_NUMBER_THREADS")), len(tasklist)) + ## thread-safe counter + cnt_tasks_done = itertools.count(start = 1) progress = len(tasklist) >= 100 if progress: msg = "Checking sstate mirror object availability" |