public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Henning Schild <henning.schild@siemens.com>
To: Anton Mikanovich <amikan@ilbers.de>
Cc: isar-users@googlegroups.com
Subject: Re: [PATCH v4 2/5] dpkg: Limit unmount loop
Date: Mon, 16 Aug 2021 18:09:13 +0200	[thread overview]
Message-ID: <20210816180913.763d84a6@md1za8fc.ad001.siemens.net> (raw)
In-Reply-To: <20210816153756.3549038-3-amikan@ilbers.de>

Am Mon, 16 Aug 2021 18:37:53 +0300
schrieb Anton Mikanovich <amikan@ilbers.de>:

> In the past, unmounting WORKDIR caused infinite looping with the
> "Couldn't unmount, retrying..." warning if the first linux-mainline
> task failed and the second one succeeded (it is built for
> de0-nano-soc-buster and stm32mp15x-buster).
> 
> This change limits the loop to 1000 s.
> 
> Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
> ---
>  meta/classes/dpkg-base.bbclass | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/meta/classes/dpkg-base.bbclass
> b/meta/classes/dpkg-base.bbclass index 4b189f1..105a1e6 100644
> --- a/meta/classes/dpkg-base.bbclass
> +++ b/meta/classes/dpkg-base.bbclass
> @@ -157,14 +157,16 @@ dpkg_do_mounts() {
>  }
>  
>  dpkg_undo_mounts() {
> -    i=1
> +    i=0
>      while ! sudo umount ${BUILDROOT}; do
>          sleep 0.1
> -        i=`expr $i + 1`
> -        if [ $i -gt 100 ]; then
> -            bbwarn "${BUILDROOT}: Couldn't unmount, retrying..."
> -            i=1
> +        if [ `expr $i % 100` -eq 0 ] ; then
> +            bbwarn "${BUILDROOT}: Couldn't unmount ($i), retrying..."
> +        fi
> +        if [ $i -gt 10000 ]; then
> +            bbfatal "${BUILDROOT}: Couldn't unmount after timeout"
>          fi
> +        i=`expr $i + 1`

IMHO it would be easier to read how long that will take in total ... if
it was "sleep 1" ... "% 10" and "-gt 1000" ... in fact i think it
should be "-ge 1000" now that you start with 0. But on off-by-one in a
timeout it not the biggest problem.

Henning

>      done
>      sudo rmdir ${BUILDROOT}
>  }


  reply	other threads:[~2021-08-16 16:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-16 15:37 [PATCH v4 0/5] Restore downstream mounts compatibility Anton Mikanovich
2021-08-16 15:37 ` [PATCH v4 1/5] Revert "dpkg: Make mount buildroot reliable" Anton Mikanovich
2021-08-16 15:37 ` [PATCH v4 2/5] dpkg: Limit unmount loop Anton Mikanovich
2021-08-16 16:09   ` Henning Schild [this message]
2021-08-16 15:37 ` [PATCH v4 3/5] image: Add reference counter Anton Mikanovich
2021-08-16 15:37 ` [PATCH v4 4/5] dpkg-base: Clean up unmounting in do_dpkg_build() Anton Mikanovich
2021-08-16 15:37 ` [PATCH v4 5/5] events: Do not warn on left mounts by default Anton Mikanovich
2021-08-16 15:53   ` Henning Schild
2021-08-16 16:53     ` Jan Kiszka
2021-08-17 12:36     ` 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=20210816180913.763d84a6@md1za8fc.ad001.siemens.net \
    --to=henning.schild@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