From: Mark Hatle <mark.hatle@windriver.com>
To: <bitbake-devel@lists.openembedded.org>
Subject: [PATCH 4/7] gitsm.py: Optimize code and attempt to resolve locking issue
Date: Tue, 15 Jan 2019 16:31:34 -0500 [thread overview]
Message-ID: <20190115213137.113956-5-mark.hatle@windriver.com> (raw)
In-Reply-To: <20190115213137.113956-1-mark.hatle@windriver.com>
It was reported that a race condition on a shared download directory could
occur with the gitsm fetcher, the result happened with a call to
git config
that occured within the update_submodules. Since the fetch is locked by the
upper level, it was probably the prior need_update(...) function causing this
because of some old code.
The gitsm class inherits the git class. The need_update was overridding the
version in gitsm, so that it forceably checked the submodules.
It's clear we can optimize the code by only updating if the primary repository
needs updating. Since we don't care if the submodule repository has changed
because if the primary hasn't, references to the submodule won't change.
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
lib/bb/fetch2/gitsm.py | 14 --------------
1 file changed, 14 deletions(-)
diff --git a/lib/bb/fetch2/gitsm.py b/lib/bb/fetch2/gitsm.py
index dd94186..11bfa66 100644
--- a/lib/bb/fetch2/gitsm.py
+++ b/lib/bb/fetch2/gitsm.py
@@ -148,20 +148,6 @@ class GitSM(Git):
return True
- def need_update(self, ud, d):
- main_repo_needs_update = Git.need_update(self, ud, d)
-
- # First check that the main repository has enough history fetched. If it doesn't, then we don't
- # even have the .gitmodules and gitlinks for the submodules to attempt asking whether the
- # submodules' histories are recent enough.
- if main_repo_needs_update:
- return True
-
- # Now check that the submodule histories are new enough. The git-submodule command doesn't have
- # any clean interface for doing this aside from just attempting the checkout (with network
- # fetched disabled).
- return not self.update_submodules(ud, d)
-
def download(self, ud, d):
Git.download(self, ud, d)
--
1.8.3.1
next prev parent reply other threads:[~2019-01-15 21:32 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-15 21:31 [PATCH 0/7 v2] gitsm.py: submodule init and ssh url processing Mark Hatle
2019-01-15 21:31 ` [PATCH 1/7] gitsm.py: Fix when a submodule is defined, but not initialized Mark Hatle
2019-01-18 15:07 ` Khem Raj
2019-01-18 18:07 ` Mark Hatle
2019-01-18 18:31 ` Khem Raj
2019-01-18 21:20 ` Mark Hatle
2019-01-18 23:06 ` Mark Hatle
2019-01-19 1:27 ` Khem Raj
2019-01-19 6:44 ` Khem Raj
2019-01-22 20:43 ` Mark Hatle
2019-01-23 3:36 ` Khem Raj
2019-01-15 21:31 ` [PATCH 2/7] gitsm.py: Add support for alternative URL formats from submodule files Mark Hatle
2019-01-15 21:31 ` [PATCH 3/7] tests/fetch.py: Add alternative gitsm test case Mark Hatle
2019-01-15 21:31 ` Mark Hatle [this message]
2019-01-15 21:31 ` [PATCH 5/7] gitsm.py: revise unpack Mark Hatle
2019-01-15 21:31 ` [PATCH 6/7] gitsm.py: Rework the shallow fetcher and test case Mark Hatle
2019-01-15 21:31 ` [PATCH 7/7] gitsm.py: Refactor the functions and simplify the class Mark Hatle
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=20190115213137.113956-5-mark.hatle@windriver.com \
--to=mark.hatle@windriver.com \
--cc=bitbake-devel@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