Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: jasper@fancydomain.eu, bitbake-devel@lists.openembedded.org
Cc: martin@mko.dev, Daniel.Baumgart@iris-sensing.net,
	openembedded-core@lists.openembedded.org,
	Jasper Orschulko <Jasper.Orschulko@iris-sensing.com>
Subject: Re: [bitbake-devel] [PATCH 2/2] fetch2: Fix race condition in latest_revision
Date: Sun, 07 Nov 2021 08:54:55 +0000	[thread overview]
Message-ID: <cf04f6c310491ca861ce5073dc14554bcba99ebc.camel@linuxfoundation.org> (raw)
In-Reply-To: <20211105133048.19879-2-jasper@fancydomain.eu>

On Fri, 2021-11-05 at 14:30 +0100, Jasper Orschulko via lists.openembedded.org
wrote:
> From: Martin Koppehel <martin@mko.dev>
> 
> Setting latest_revision contained a race condition, where it would be
> set to an empty string, if the hash calculation function would take to
> long.
> 
> Signed-off-by: Jasper Orschulko <Jasper.Orschulko@iris-sensing.com>
> ---
>  lib/bb/fetch2/__init__.py | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
> index 6a38cb09..9dc23d05 100644
> --- a/lib/bb/fetch2/__init__.py
> +++ b/lib/bb/fetch2/__init__.py
> @@ -1602,7 +1602,9 @@ class FetchMethod(object):
>          try:
>              return revs[key]
>          except KeyError:
> -            revs[key] = rev = self._latest_revision(ud, d, name)
> +            rev = self._latest_revision(ud, d, name)
> +            if rev != '':
> +                revs[key] = rev
>              return rev
>  
>      def sortable_revision(self, ud, d, name):

I'm afraid I don't understand why this is a race condition? Where is the timeout
that stops one being set?

Cheers,

Richard



  reply	other threads:[~2021-11-07  8:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-05 13:30 [PATCH 1/2] fetch2/repo: Implement AUTOREV for repo fetcher Jasper Orschulko
2021-11-05 13:30 ` [PATCH 2/2] fetch2: Fix race condition in latest_revision Jasper Orschulko
2021-11-07  8:54   ` Richard Purdie [this message]
     [not found]     ` <5538dd6d-94df-af1f-8141-4d6b63f119d1@mko.dev>
2021-11-08 10:28       ` [bitbake-devel] " Alexander Kanavin
2021-11-10 15:45         ` Jasper Orschulko

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=cf04f6c310491ca861ce5073dc14554bcba99ebc.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=Daniel.Baumgart@iris-sensing.net \
    --cc=Jasper.Orschulko@iris-sensing.com \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=jasper@fancydomain.eu \
    --cc=martin@mko.dev \
    --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