public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Anton Mikanovich <amikan@ilbers.de>, isar-users@googlegroups.com
Subject: Re: [PATCH v3 0/5] Rebuild mount logic
Date: Mon, 21 Jun 2021 17:54:10 +0200	[thread overview]
Message-ID: <246fd202-0ec2-563b-90fe-3c4177fda44e@siemens.com> (raw)
In-Reply-To: <20210508062518.83852-1-amikan@ilbers.de>

On 08.05.21 08:25, Anton Mikanovich wrote:
> Mounting is perfomed very inconsistent currently in Isar. A lot of mount
> points are left after task execution and stays mounted until cleanup in
> build_completed hook.
> 
> We already experienced issues with stuck forever on unmounting at
> "Couldn't unmount, retrying..." error.
> It is also quite easy to face with a lot of ramaining mounts after the
> failed or interrupted manual builds.
> 
> This patchset implements unmounting paths after usage. In the cases of
> mount sharing corresponding request counting is performed, so real mount
> will be done only at first request, real unmount will be done only after
> the last task will try to unmount the path.
> 
> Meantime build_completed will use emergency only, so following warning
> added to show something goes wrong.
> 
> ---
> Changes since v2:
> - Prevent race conditions.
> - Fix building qemuarm64-stretch.
> - Minimize locks.
> - Cleanup counter files.
> - Unmount /proc/sys/fs/binfmt_misc also.
> Changes since v1:
> - Make all mounts be unmounted after use.
> - Warn about lost mounts after finish.
> 
> Anton Mikanovich (5):
>   dpkg: Make mount buildroot reliable
>   buildchroot: Unmount buildchroot mounts if not needed
>   rootfs: Unmount rootfs mounts if not needed
>   wic: Unmount dirs after usage
>   events: Warn if mounted paths left
> 
>  meta/classes/buildchroot.bbclass              |  47 +++++++
>  meta/classes/dpkg-base.bbclass                | 127 +++++++++++-------
>  meta/classes/dpkg-gbp.bbclass                 |   8 +-
>  meta/classes/dpkg.bbclass                     |  14 +-
>  meta/classes/ext4-img.bbclass                 |   2 +
>  meta/classes/fit-img.bbclass                  |   2 +
>  meta/classes/image-tools-extension.bbclass    |   2 +
>  meta/classes/image.bbclass                    |  24 ++--
>  meta/classes/initramfs.bbclass                |   2 +
>  meta/classes/isar-events.bbclass              |   1 +
>  meta/classes/rootfs.bbclass                   |  62 ++++++++-
>  meta/classes/ubi-img.bbclass                  |   2 +
>  meta/classes/ubifs-img.bbclass                |   2 +
>  meta/classes/wic-img.bbclass                  |  10 ++
>  .../buildchroot/buildchroot.inc               |   8 ++
>  15 files changed, 232 insertions(+), 81 deletions(-)
> 

This one is still not stable (reverting my claim "current next builds 
fine"):

NOTE: recipe buildchroot-target-1.0-r0: task do_rootfs_postprocess: Started
ERROR: mc:rpi-stretch:buildchroot-target-1.0-r0 do_rootfs_postprocess: Error executing a python function in exec_python_func() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_python_func() autogenerated', lineno: 2, function: <module>
     0001:
 *** 0002:do_rootfs_postprocess(d)
     0003:
File: '/builds/Vs1BETDQ/0/ebsy/debian/isar/meta/classes/rootfs.bbclass', lineno: 298, function: do_rootfs_postprocess
     0294:        for i, cmd in enumerate(cmds):
     0295:            bb.build.exec_func(cmd, d)
     0296:            progress_reporter.update(int(i / len(cmds) * 100))
     0297:
 *** 0298:    bb.build.exec_func('rootfs_undo_mounts', d)
     0299:}
     0300:addtask rootfs_postprocess before do_rootfs
     0301:
     0302:python do_rootfs() {
File: '/builds/Vs1BETDQ/0/ebsy/debian/isar/bitbake/lib/bb/build.py', lineno: 251, function: exec_func
     0247:    with bb.utils.fileslocked(lockfiles):
     0248:        if ispython:
     0249:            exec_func_python(func, d, runfile, cwd=adir)
     0250:        else:
 *** 0251:            exec_func_shell(func, d, runfile, cwd=adir)
     0252:
     0253:    try:
     0254:        curcwd = os.getcwd()
     0255:    except:
File: '/builds/Vs1BETDQ/0/ebsy/debian/isar/bitbake/lib/bb/build.py', lineno: 452, function: exec_func_shell
     0448:    with open(fifopath, 'r+b', buffering=0) as fifo:
     0449:        try:
     0450:            bb.debug(2, "Executing shell function %s" % func)
     0451:            with open(os.devnull, 'r+') as stdin, logfile:
 *** 0452:                bb.process.run(cmd, shell=False, stdin=stdin, log=logfile, extrafiles=[(fifo,readfifo)])
     0453:        finally:
     0454:            os.unlink(fifopath)
     0455:
     0456:    bb.debug(2, "Shell function %s finished" % func)
File: '/builds/Vs1BETDQ/0/ebsy/debian/isar/bitbake/lib/bb/process.py', lineno: 182, function: run
     0178:        if not stderr is None:
     0179:            stderr = stderr.decode("utf-8")
     0180:
     0181:    if pipe.returncode != 0:
 *** 0182:        raise ExecutionError(cmd, pipe.returncode, stdout, stderr)
     0183:    return stdout, stderr
Exception: bb.process.ExecutionError: Execution of '/builds/Vs1BETDQ/0/ebsy/debian/isar/build/tmp/work/raspbian-stretch-armhf/buildchroot-target/1.0-r0/temp/run.rootfs_undo_mounts.19080' failed with exit code 32:
umount: /builds/Vs1BETDQ/0/ebsy/debian/isar/build/tmp/work/raspbian-stretch-armhf/buildchroot-target/1.0-r0/rootfs/sys/fs/cgroup: target is busy.
WARNING: exit code 32 from a shell command.


ERROR: Logfile of failure stored in: /builds/Vs1BETDQ/0/ebsy/debian/isar/build/tmp/work/raspbian-stretch-armhf/buildchroot-target/1.0-r0/temp/log.do_rootfs_postprocess.19080
NOTE: recipe buildchroot-target-1.0-r0: task do_rootfs_postprocess: Failed
ERROR: Task (mc:rpi-stretch:/builds/Vs1BETDQ/0/ebsy/debian/isar/meta/recipes-dev


And then also 

NOTE: Tasks Summary: Attempted 1181 tasks of which 214 didn't need to be rerun and 1 failed.
WARNING: /builds/Vs1BETDQ/0/ebsy/debian/isar/build/tmp/work/raspbian-stretch-armhf/buildchroot-target/1.0-r0/rootfs/dev left mounted, unmounting...
WARNING: /builds/Vs1BETDQ/0/ebsy/debian/isar/build/tmp/work/raspbian-stretch-armhf/buildchroot-target/1.0-r0/rootfs/dev/pts left mounted, unmounting...
WARNING: /builds/Vs1BETDQ/0/ebsy/debian/isar/build/tmp/work/raspbian-stretch-armhf/buildchroot-target/1.0-r0/rootfs/dev/mqueue left mounted, unmounting...
WARNING: /builds/Vs1BETDQ/0/ebsy/debian/isar/build/tmp/work/raspbian-stretch-armhf/buildchroot-target/1.0-r0/rootfs/dev/termination-log left mounted, unmounting...
WARNING: /builds/Vs1BETDQ/0/ebsy/debian/isar/build/tmp/work/raspbian-stretch-armhf/buildchroot-target/1.0-r0/rootfs/dev/shm left mounted, unmounting...
WARNING: /builds/Vs1BETDQ/0/ebsy/debian/isar/build/tmp/work/raspbian-stretch-armhf/buildchroot-target/1.0-r0/rootfs/proc left mounted, unmounting...
WARNING: /builds/Vs1BETDQ/0/ebsy/debian/isar/build/tmp/work/raspbian-stretch-armhf/buildchroot-target/1.0-r0/rootfs/sys left mounted, unmounting...
WARNING: /builds/Vs1BETDQ/0/ebsy/debian/isar/build/tmp/work/raspbian-stretch-armhf/buildchroot-target/1.0-r0/rootfs/sys/fs/cgroup left mounted, unmounting...
WARNING: /builds/Vs1BETDQ/0/ebsy/debian/isar/build/tmp/work/raspbian-stretch-armhf/buildchroot-target/1.0-r0/rootfs/sys/fs/cgroup/cpuset left mounted, unmounting...
WARNING: /builds/Vs1BETDQ/0/ebsy/debian/isar/build/tmp/work/raspbian-stretch-armhf/buildchroot-target/1.0-r0/rootfs/downloads left mounted, unmounting...

Summary: 1 task failed:
  mc:rpi-stretch:/builds/Vs1BETDQ/0/ebsy/debian/isar/meta/recipes-devtools/buildchroot/buildchroot-target.bb:do_rootfs_postprocess


Though I suspect and hope the latter is related to the former.

Retrying, to see if we have a race (likely) or something stable.

Jan

-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux

  parent reply	other threads:[~2021-06-21 15:54 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-08  6:25 Anton Mikanovich
2021-05-08  6:25 ` [PATCH v3 1/5] dpkg: Make mount buildroot reliable Anton Mikanovich
2021-06-08  8:09   ` Henning Schild
2021-06-08  8:31     ` Anton Mikanovich
2021-06-08  8:49       ` Henning Schild
2021-07-01 11:55   ` Jan Kiszka
2021-05-08  6:25 ` [PATCH v3 2/5] buildchroot: Unmount buildchroot mounts if not needed Anton Mikanovich
2021-05-08  6:25 ` [PATCH v3 3/5] rootfs: Unmount rootfs " Anton Mikanovich
2021-05-08  6:25 ` [PATCH v3 4/5] wic: Unmount dirs after usage Anton Mikanovich
2021-05-08  6:25 ` [PATCH v3 5/5] events: Warn if mounted paths left Anton Mikanovich
2021-07-01 11:51   ` Jan Kiszka
2021-06-08  7:58 ` [PATCH v3 0/5] Rebuild mount logic Henning Schild
2021-06-08  8:15   ` Anton Mikanovich
2021-06-08  8:42     ` Henning Schild
2021-06-08  8:54     ` Henning Schild
2021-06-10  7:12       ` Anton Mikanovich
2021-06-10 15:02         ` Henning Schild
2021-06-21 15:54 ` Jan Kiszka [this message]
2021-06-22 14:40   ` Anton Mikanovich

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=246fd202-0ec2-563b-90fe-3c4177fda44e@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=amikan@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