All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
To: Richard Purdie <richard.purdie@linuxfoundation.org>,
	"bitbake-devel@lists.openembedded.org"
	<bitbake-devel@lists.openembedded.org>
Subject: RE: [bitbake-devel] [PATCH 14/15] cache: Drop reciever side counting for SiggenRecipeInfo
Date: Fri, 30 Dec 2022 15:46:12 +0000	[thread overview]
Message-ID: <01f95d7bd4764f0c814347d9b712b524@axis.com> (raw)
In-Reply-To: <20221229170728.880367-15-richard.purdie@linuxfoundation.org>

> -----Original Message-----
> From: bitbake-devel@lists.openembedded.org <bitbake-devel@lists.openembedded.org> On Behalf Of Richard Purdie
> Sent: den 29 december 2022 18:07
> To: bitbake-devel@lists.openembedded.org
> Subject: [bitbake-devel] [PATCH 14/15] cache: Drop reciever side counting for SiggenRecipeInfo

Change "reciever" to "receiver".

> 
> Joshua Watt pointed out maintaining the counting on both sides of the
> connection isn't needed. Remove the receiver side counting and simplify
> the code, also allowing errors if the counts do go out of sync.
> 
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
>  lib/bb/cache.py | 15 ++++++++-------
>  1 file changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/lib/bb/cache.py b/lib/bb/cache.py
> index 3fc097241a..ee924b2d2b 100644
> --- a/lib/bb/cache.py
> +++ b/lib/bb/cache.py
> @@ -285,7 +285,6 @@ class SiggenRecipeInfo(RecipeInfoCommon):
>          cls.save_map = {}
>          cls.save_count = 1
>          cls.restore_map = {}
> -        cls.restore_count = {}
> 
>      @classmethod
>      def _save(cls, deps):
> @@ -294,11 +293,13 @@ class SiggenRecipeInfo(RecipeInfoCommon):
>              return deps
>          for dep in deps:
>              fs = deps[dep]
> -            if fs in cls.save_map:
> +            if fs is None:
> +                ret.append((dep, None, None))
> +            elif fs in cls.save_map:
>                  ret.append((dep, None, cls.save_map[fs]))
>              else:
>                  cls.save_map[fs] = cls.save_count
> -                ret.append((dep, fs, None))
> +                ret.append((dep, fs, cls.save_count))
>                  cls.save_count = cls.save_count + 1
>          return ret
> 
> @@ -309,18 +310,18 @@ class SiggenRecipeInfo(RecipeInfoCommon):
>              return deps
>          if pid not in cls.restore_map:
>              cls.restore_map[pid] = {}
> -            cls.restore_count[pid] = 1
>          map = cls.restore_map[pid]
>          for dep, fs, mapnum in deps:
> -            if mapnum:
> +            if fs is None and mapnum is None:
> +                ret[dep] = None
> +            elif fs is None:
>                  ret[dep] = map[mapnum]
>              else:
>                  try:
>                      fs = cls.store[fs]
>                  except KeyError:
>                      cls.store[fs] = fs
> -                map[cls.restore_count[pid]] = fs
> -                cls.restore_count[pid] = cls.restore_count[pid] + 1
> +                map[mapnum] = fs
>                  ret[dep] = fs
>          return ret
> 
> --
> 2.37.2

//Peter



  reply	other threads:[~2022-12-30 15:46 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-29 17:07 [PATCH 00/15] Bitbake server thread enabling Richard Purdie
2022-12-29 17:07 ` [PATCH 01/15] command: Tweak finishAsyncCommand ordering to avoid races Richard Purdie
2022-12-29 17:07 ` [PATCH 02/15] cooker: Ensure commands clean up any parser processes Richard Purdie
2022-12-29 17:07 ` [PATCH 03/15] knotty: Ping the server/cooker periodically Richard Purdie
2022-12-30 15:44   ` [bitbake-devel] " Peter Kjellerstedt
2022-12-29 17:07 ` [PATCH 04/15] event: Add enable/disable heartbeat code Richard Purdie
2022-12-29 17:07 ` [PATCH 05/15] server/process: Run idle commands in a separate idle thread Richard Purdie
2022-12-29 17:07 ` [PATCH 06/15] server/process: Improve idle loop exit code Richard Purdie
2022-12-29 17:07 ` [PATCH 07/15] process: Improve client disconnect/idle sync Richard Purdie
2022-12-29 17:07 ` [PATCH 08/15] process: Improve async command execution with idle interaction Richard Purdie
2022-12-29 17:07 ` [PATCH 09/15] knotty: Avoid looping with tracebacks Richard Purdie
2022-12-29 17:07 ` [PATCH 10/15] event: Always use threadlock Richard Purdie
2022-12-29 17:07 ` [PATCH 11/15] server/process: Improve exception logging Richard Purdie
2022-12-29 17:07 ` [PATCH 12/15] cooker/cookerdata: Rework the way the datastores are reset Richard Purdie
2022-12-29 17:07 ` [PATCH 13/15] cooker: Ensure we clean up active idle handlers Richard Purdie
2022-12-29 17:07 ` [PATCH 14/15] cache: Drop reciever side counting for SiggenRecipeInfo Richard Purdie
2022-12-30 15:46   ` Peter Kjellerstedt [this message]
2022-12-29 17:07 ` [PATCH 15/15] server/process: Add debug to show which handlers are active 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=01f95d7bd4764f0c814347d9b712b524@axis.com \
    --to=peter.kjellerstedt@axis.com \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.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 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.