public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Alexander Smirnov <asmirnov@ilbers.de>,
	isar-users <isar-users@googlegroups.com>
Subject: Re: Build can sporadically fail due to dpkg contention in buildchroot
Date: Sun, 11 Feb 2018 19:18:10 +0100	[thread overview]
Message-ID: <d38bf905-bf03-37f9-3c3f-f1c637f8af45@siemens.com> (raw)
In-Reply-To: <4d2b9322-54ed-ddff-739e-d0a3d5c6cc7b@ilbers.de>

On 2018-02-11 17:55, Alexander Smirnov wrote:
> Hi,
> 
> On 02/11/2018 06:17 PM, Jan Kiszka wrote:
>> Hi all,
>>
>> I got this failure of example-hello:do_build already twice while doing
>> rebuild tests with my kernel series (ie. with more independent
>> buildchroot users):
>>
>> DEBUG: Executing shell function do_build
>> Get:1 file:/isar-apt isar InRelease
>> Ign:1 file:/isar-apt isar InRelease
>> Get:2 file:/isar-apt isar Release [2,864 B]
>> Get:2 file:/isar-apt isar Release [2,864 B]
>> Get:3 file:/isar-apt isar Release.gpg
>> Ign:3 file:/isar-apt isar Release.gpg
>> Get:4 file:/isar-apt isar/main amd64 Packages [1,135 B]
>> Reading package lists...
>> W: The repository 'file:/isar-apt isar Release' is not signed.
>> hostname: No address associated with hostname
>> dh_testdir
>> dh_testroot
>> dh_prep
>> dh_testdir
>> dh_testroot
>> dh_install
>> dh_install: Compatibility levels before 9 are deprecated (level 7 in use)
>> dh_installdocs
>> dh_installdocs: Compatibility levels before 9 are deprecated (level 7
>> in use)
>> dh_installchangelogs
>> dh_compress
>> dh_fixperms
>> dh_installdeb
>> dh_installdeb: Compatibility levels before 9 are deprecated (level 7
>> in use)
>> dh_gencontrol
>> dh_md5sums
>> dh_builddeb
>> dpkg-deb: building package 'hello-build-deps' in
>> '../hello-build-deps_0.2_all.deb'.
>>
> 
> Good catch!
> 
>> The package has been created.
>> Attention, the package has been created in the current directory,
>> not in ".." as indicated by the message above!
>> dpkg: error: dpkg status database is locked by another process
>> mk-build-deps: dpkg --unpack failed
>> [...]
>>
>> So we have a concurrency problem when building over the same dpkg
>> database. Looks like we need to synchronize (lock-protect) the access to
>> it, which also means pulling out the dependency installation from the
>> regular build step. Is that feasible at all? Any alternatives (besides
>> retrying such builds...)?
> 
> In general we could do this easily:
> 
> 1. Split the content of build.sh into two functions, for example:
>  - install_build_deps
>  - build_package
> 
> 2. Spit the bitbake do_build() into two tasks:
> 
> do_install_build_deps() {
>     ... build.sh install_build_deps ...
> }
> 
> addtask install_build_deps before do_build after do_unpack
> 
> do_build_package() {
>     ... build.sh build_package ...
> }
> 
> 3. Using bitbake synchronization primitives, protect the fist task from
> parallel execution.
> 
> If you are OK with this, I could do this tomorrow.

I'm still concerned how well this will scale:

a) We have additional users we already know of (linux-kernel.bbclass).
   We will need to provide them the same means.

b) There might be more users hidden in today's or future recipes...

Jan

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

  reply	other threads:[~2018-02-11 18:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-11 15:17 Jan Kiszka
2018-02-11 16:55 ` Alexander Smirnov
2018-02-11 18:18   ` Jan Kiszka [this message]
2018-02-11 18:44     ` Alexander Smirnov
2018-02-12  7:42       ` Jan Kiszka
2018-02-14 15:02         ` Jan Kiszka
2018-02-14 17:57           ` Alexander Smirnov
2018-02-14 18:04             ` Jan Kiszka

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=d38bf905-bf03-37f9-3c3f-f1c637f8af45@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=asmirnov@ilbers.de \
    --cc=isar-users@googlegroups.com \
    /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