From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6982225001537601536 X-Received: by 2002:adf:f346:: with SMTP id e6mr17099399wrp.28.1625746893935; Thu, 08 Jul 2021 05:21:33 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:600c:35c4:: with SMTP id r4ls955474wmq.3.gmail; Thu, 08 Jul 2021 05:21:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwz7+Jn4vWtybufPr7kNh5W9aS8CqlwwF36mhShGXbN//tR0zuKUDljOri3PjZhnVPTMZoH X-Received: by 2002:a1c:f216:: with SMTP id s22mr32655202wmc.18.1625746893025; Thu, 08 Jul 2021 05:21:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625746893; cv=none; d=google.com; s=arc-20160816; b=g23UXzwzTEvnD7CutufFBNAyDdqXDBwNJ79iBxhLVTswW5rIx5tTYolVgkbjs1mXRU /HRzwm4V2skpnSyasi+DewAxZRod9BtxHtrOvSBqTwd1PkC3zi6V3txv0WQaeiqkvWBg 6x7ZQTpRI0w++1w77J46y1HtN1IcJm49BQWs13wesOoioadSkwifQ0CMT9NADI3Sjj1h CJGqJhZyq+CI233LyUtGXAGBBW7qAhA57dtBb9eZ8KMWqFwJmXYcX4fnVzhfWsUK8aCc 4mCSr7GCyRTfuIytUMvzFXLehrE8YGQa83/kQtEingah+qo9lb9bkqVYyImEN5RlV8uw zJDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:subject; bh=SBYDjP/GPVp2i8OGQtHRoLqgnuK2FTtcSwZSiyg5Kcc=; b=yZm5kw3tHaBfDtdnydxkg83YYPZdBptElTgBh7sSKX4CRiP2nr3lRxnEheheMwlmWc kCCryXWCgSuoq6rb3EA/r5LsGSisyq6khUJ7YRfw0MezpqYUFHzceTDABTsgAsl9a1l5 7d5+hBbMW7iO9yTTG+W8sOVXhfoeMCJeh1RveIK3gSciW9LuaxZtcxrvvbpFi82qE/jV EVag5Q7LBKAAEWugQEsAJZ8HxeA1o45j7PL/WAIZw40Db9KSGTij4KRxF0OigM8J0ZXN E4Nx1oCFo/sy1vFnTx/esZ41b50n+QMHGq7QRZji9DdGHlZwjiu+JqTrcfDjNMhN8VpH FQgg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from lizzard.sbs.de (lizzard.sbs.de. [194.138.37.39]) by gmr-mx.google.com with ESMTPS id p19si327478wmq.4.2021.07.08.05.21.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Jul 2021 05:21:33 -0700 (PDT) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 194.138.37.39 as permitted sender) client-ip=194.138.37.39; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by lizzard.sbs.de (8.15.2/8.15.2) with ESMTPS id 168CLWI0006369 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 8 Jul 2021 14:21:32 +0200 Received: from [167.87.42.31] ([167.87.42.31]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 168CLWIl014943; Thu, 8 Jul 2021 14:21:32 +0200 Subject: Re: [PATCH v1 3/5] dpkg: Remove unmount loop To: Anton Mikanovich , isar-users@googlegroups.com References: <20210707163851.204296-1-amikan@ilbers.de> <20210707163851.204296-4-amikan@ilbers.de> From: Jan Kiszka Message-ID: <18078814-c9c0-b46b-af32-17058c39f036@siemens.com> Date: Thu, 8 Jul 2021 14:21:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210707163851.204296-4-amikan@ilbers.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: h4pqTW9EdmJo On 07.07.21 18:38, Anton Mikanovich wrote: > Remove while loop when trying to unmount WORKDIR. Any failures of > umount should be investigated to fix the root cause. > Also make dpkg_undo_mounts do not fail if dpkg_do_mounts was not > called or it was called twice. > This is very likely wrong: We know from the past (should be in the git history, e.g 17d0842d) that not all subprocesses started inside the chroot may have been terminated when we left it. That can cause significant delays between returning from chroot and finding non-busy mount points to complete all umounts. Now, if you silently fail umounts, you may find inconsistently mounted chroots on the next recipe that tries to remount them. Big fat warning sign...! Jan > Signed-off-by: Anton Mikanovich > --- > meta/classes/dpkg-base.bbclass | 15 +++++---------- > 1 file changed, 5 insertions(+), 10 deletions(-) > > diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass > index 97661a6..6c84f3a 100644 > --- a/meta/classes/dpkg-base.bbclass > +++ b/meta/classes/dpkg-base.bbclass > @@ -154,16 +154,11 @@ dpkg_do_mounts() { > } > > dpkg_undo_mounts() { > - i=1 > - 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 > - fi > - done > - sudo rmdir ${BUILDROOT} > + buildchroot_undo_mounts > + > + mountpoint -q '${BUILDROOT}' && \ > + sudo umount ${BUILDROOT} && \ > + sudo rmdir ${BUILDROOT} || true > } > > # Placeholder for actual dpkg_runbuild() implementation > -- Siemens AG, T RDA IOT Corporate Competence Center Embedded Linux