From: Denys Dmytriyenko <denis@denix.org>
To: openembedded-devel@lists.openembedded.org
Subject: Re: [Patch] locking in do_package_tar
Date: Fri, 23 Apr 2010 11:55:15 -0400 [thread overview]
Message-ID: <20100423155515.GA27322@denix.org> (raw)
In-Reply-To: <4BD170BC.8020103@road.de>
On Fri, Apr 23, 2010 at 12:04:44PM +0200, Jens Erdmann wrote:
> Hey folks,
>
> I would like to introduce locking in do_package_tar. I had a case here were
> do_package_tar and do_package_ipk where running parallel. Because of this
> "tar: .: file changed as we read it" occurs. I fixed it by introduce
> locking in do_package_tar. What do you think about it?
Ah, I've been suffering from this problem for quite some time now, when making
parallel builds with BB_NUMBER_THREADS. I was trying to debug it and noticed
it would fail when kernel recipe would try to do_deploy at the same time
another package would try to do_package_stage, so I was digging in the
packaged staging direction. Tom Rini even made a patch to add an extra lock in
there, which didn't help with my issue...
So, let me try your patch and see if this problem is gone for good! Thanks.
--
Denys
> --
> ------- ROAD ...the handyPC Company - - - ) ) )
>
> Jens Erdmann
> Software Development
>
> ROAD GmbH
> Bennigsenstr. 14 | 12159 Berlin | Germany
> fon: +49 (30) 230069 - 64 | fax: +49 (30) 230069 - 69
> url: www.road.de
>
> Amtsgericht Charlottenburg: HRB 96688 B
> Managing director: Hans-Peter Constien
>
> diff --git a/classes/package_tar.bbclass b/classes/package_tar.bbclass
> index b905e17..47bf2cc 100644
> --- a/classes/package_tar.bbclass
> +++ b/classes/package_tar.bbclass
> @@ -58,6 +58,7 @@ python do_package_tar () {
> localdata = bb.data.createCopy(d)
> pkgdest = bb.data.getVar('PKGDEST', d, 1)
> root = "%s/%s" % (pkgdest, pkg)
> + lf = bb.utils.lockfile(root + ".lock")
>
> bb.data.setVar('ROOT', '', localdata)
> bb.data.setVar('ROOT_%s' % pkg, root, localdata)
> @@ -65,6 +66,7 @@ python do_package_tar () {
>
> overrides = bb.data.getVar('OVERRIDES', localdata)
> if not overrides:
> + bb.utils.unlockfile(lf)
> raise bb.build.FuncFailed('OVERRIDES not defined')
> overrides = bb.data.expand(overrides, localdata)
> bb.data.setVar('OVERRIDES', '%s:%s' % (overrides, pkg), localdata)
> @@ -82,10 +84,12 @@ python do_package_tar () {
> from glob import glob
> if not glob('*') + glob('.[!.]*'):
> bb.note("Not creating empty archive for %s-%s" % (pkg, bb.data.expand('${PV}-${PR}${DISTRO_PR}', d, True)))
> + bb.utils.unlockfile(lf)
> continue
> ret = os.system("tar -czf %s %s" % (tarfn, '.'))
> if ret != 0:
> bb.error("Creation of tar %s failed." % tarfn)
> + bb.utils.unlockfile(lf)
> }
>
> python () {
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
next prev parent reply other threads:[~2010-04-23 15:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-23 10:04 [Patch] locking in do_package_tar Jens Erdmann
2010-04-23 15:55 ` Denys Dmytriyenko [this message]
2010-04-24 16:56 ` Denys Dmytriyenko
2010-04-26 8:57 ` Jens Erdmann
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=20100423155515.GA27322@denix.org \
--to=denis@denix.org \
--cc=openembedded-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