public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "Moessbauer, Felix" <felix.moessbauer@siemens.com>
To: "isar-users@googlegroups.com" <isar-users@googlegroups.com>
Cc: "jan.kiszka@siemens.com" <jan.kiszka@siemens.com>,
	"henning.schild@siemens.com" <henning.schild@siemens.com>
Subject: RE: [PATCH 3/4] fix race by serialize rootfs_finalize and do_wic_image
Date: Thu, 23 Sep 2021 08:39:00 +0000	[thread overview]
Message-ID: <AM9PR10MB486993C84EF013E017B7A41D89A39@AM9PR10MB4869.EURPRD10.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20210922171507.40a81eb3@md1za8fc.ad001.siemens.net>

Hi,

I had a second look at the task graph and this patch is wrong / redundant.
The do_image_tools task already depends on do_rootfs which itself depends on do_rootfs_finalize.

By that, also the splitting of the finalize / unmount in patch 4 does not work out.
This likely explains why we get a deadlock in do_container_image when building a container image which is then included into a regular wic image with this patch series.

What really helped is to have a look at the task dependency graph which can be exported as dot file:
bitbake -g recipe-name -u ncurses
xdot build/task-depends.dot

I'll send out a v2 soon, containing just the first two patches.

Best regards,
Felix

> -----Original Message-----
> From: Henning Schild <henning.schild@siemens.com>
> Sent: Wednesday, September 22, 2021 5:15 PM
> To: Moessbauer, Felix (T RDA IOT SES-DE)
> <felix.moessbauer@siemens.com>
> Cc: isar-users@googlegroups.com; Kiszka, Jan (T RDA IOT)
> <jan.kiszka@siemens.com>
> Subject: Re: [PATCH 3/4] fix race by serialize rootfs_finalize and
> do_wic_image
> 
> Am Wed, 22 Sep 2021 11:27:53 +0200
> schrieb Felix Moessbauer <felix.moessbauer@siemens.com>:
> 
> > The do_wic_image task requires a mounted buildchroot.
> > Prior to this patch, the wic_do_mounts task and do_rootfs_finalize
> > were not ordered. By that, the do_rootfs_finalize task could run in
> > parallel and unmount the buildchroot.
> 
> That is not just a mounting issue. The finalize should be done before any
> imager goes to create an image. Because finalize contains quite a bit of "rm -
> f".
> 
> If the actual imager task and finalize have not been serialized, we need to
> look into that for all our imagers, not just wic.
> 
> The pattern we use is that imagers usually do
> 
> addtask <something>_image before do_image after do_image_tools
> 
> and it is also in ubifs cpiogz ext4 fit container ...
> 
> We need to touch all of them. Or play a global trick like
> 
> addtask image_tools after do_rootfs_finalize
> 
> to catch them all and possibly also catch the ones in layers.
> 
> Henning
> 
> > This is now fixed by adding the do_rootfs_finalize as a task
> > dependency.
> >
> > Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
> > ---
> >  meta/classes/wic-img.bbclass | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/meta/classes/wic-img.bbclass
> > b/meta/classes/wic-img.bbclass index e495c12..573537c 100644
> > --- a/meta/classes/wic-img.bbclass
> > +++ b/meta/classes/wic-img.bbclass
> > @@ -147,7 +147,7 @@ python do_wic_image() {
> >          bb.build.exec_func("wic_undo_mounts", d)
> >          bb.utils.unlockfile(lock)
> >  }
> > -addtask wic_image before do_image after do_image_tools
> > +addtask wic_image before do_image after do_image_tools
> > do_rootfs_finalize
> >  wic_do_mounts() {
> >      buildchroot_do_mounts


  reply	other threads:[~2021-09-23  8:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-22  9:27 [PATCH 0/4] Fix sporadic failures in do_wic_image Felix Moessbauer
2021-09-22  9:27 ` [PATCH 1/4] fix typo in do_rootfs_finalize Felix Moessbauer
2021-09-22 15:02   ` Henning Schild
2021-09-22  9:27 ` [PATCH 2/4] execute do_wic_image under a lock to ensure mountpoints remain mounted Felix Moessbauer
2021-09-22 15:04   ` Henning Schild
2021-09-22  9:27 ` [PATCH 3/4] fix race by serialize rootfs_finalize and do_wic_image Felix Moessbauer
2021-09-22 15:15   ` Henning Schild
2021-09-23  8:39     ` Moessbauer, Felix [this message]
2021-09-22  9:27 ` [PATCH 4/4] split rootfs finalization and unmounting into two tasks Felix Moessbauer
2021-09-22 15:23   ` Henning Schild

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=AM9PR10MB486993C84EF013E017B7A41D89A39@AM9PR10MB4869.EURPRD10.PROD.OUTLOOK.COM \
    --to=felix.moessbauer@siemens.com \
    --cc=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.com \
    --cc=jan.kiszka@siemens.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