From: Jan Kiszka <jan.kiszka@siemens.com>
To: Alexander Smirnov <asmirnov@ilbers.de>,
isar-users <isar-users@googlegroups.com>
Subject: Re: [PATCH 2/8] isar-events: Wait for failing umounts
Date: Mon, 19 Feb 2018 10:48:36 +0100 [thread overview]
Message-ID: <70af17d0-be54-60c6-a11f-0a5047abea33@siemens.com> (raw)
In-Reply-To: <f96bc6fe-05dc-a294-0a2b-ef0b7ce1ef18@ilbers.de>
On 2018-02-19 10:45, Alexander Smirnov wrote:
> On 02/16/2018 11:52 AM, Jan Kiszka wrote:
>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>
>> The BuildCompleted event may come prior to all running build processes
>> being terminated. In that case, some mount might be busy, and we will
>> leave them dangling behind. Wait in that case.
>
> How long we should wait?
Until it's done.
> For example there was a bug with apt-get which
> results as hanging of 'http' process. So in this case Isar never returns
> to command prompt until second ^C pressed.
In that case, you need to run around killing processes anyway.
Jan
>
> Alex
>
>>
>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>> ---
>> meta/classes/isar-events.bbclass | 28 +++++++++++++++++++---------
>> 1 file changed, 19 insertions(+), 9 deletions(-)
>>
>> diff --git a/meta/classes/isar-events.bbclass
>> b/meta/classes/isar-events.bbclass
>> index 4b5e97e..68208f1 100644
>> --- a/meta/classes/isar-events.bbclass
>> +++ b/meta/classes/isar-events.bbclass
>> @@ -2,11 +2,26 @@
>> #
>> # This software is a part of ISAR.
>> # Copyright (C) 2015-2017 ilbers GmbH
>> +# Copyright (c) Siemens AG, 2018
>> addhandler isar_handler
>> python isar_handler () {
>> import subprocess
>> + import time
>> +
>> + def umount_all(basepath):
>> + # '/proc/mounts' contains all the active mounts, so knowing
>> basepath
>> + # we can get the list of mounts for the specific multiconfig and
>> + # clean them.
>> + with open('/proc/mounts', 'rU') as f:
>> + for line in f:
>> + if basepath in line:
>> + if subprocess.call('sudo umount ' + line.split()[1],
>> + stdout=devnull, stderr=devnull,
>> + shell=True) != 0:
>> + return False
>> + return True
>> devnull = open(os.devnull, 'w')
>> @@ -16,15 +31,10 @@ python isar_handler () {
>> arch = d.getVar('DISTRO_ARCH', True)
>> if tmpdir and distro and arch:
>> - w = tmpdir + '/work/' + distro + '-' + arch
>> -
>> - # '/proc/mounts' contains all the active mounts, so
>> knowing 'w' we
>> - # could get the list of mounts for the specific
>> multiconfig and
>> - # clean them.
>> - with open('/proc/mounts', 'rU') as f:
>> - for line in f:
>> - if w in line:
>> - subprocess.call('sudo umount -f ' +
>> line.split()[1], stdout=devnull, stderr=devnull, shell=True)
>> + basepath = tmpdir + '/work/' + distro + '-' + arch
>> +
>> + while not umount_all(basepath):
>> + time.sleep(1)
>> devnull.close()
>> }
>>
>
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
next prev parent reply other threads:[~2018-02-19 9:48 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-16 8:52 [PATCH 0/8] Assorted patches Jan Kiszka
2018-02-16 8:52 ` [PATCH 1/8] Mount devtmpfs read-only into chroot Jan Kiszka
2018-02-19 10:09 ` Consolidate mounting in tasks (was Re: [PATCH 1/8] Mount devtmpfs read-only into chroot) Claudius Heine
2018-02-20 6:38 ` [PATCH 1/8] Mount devtmpfs read-only into chroot Alexander Smirnov
2018-02-20 7:02 ` Alexander Smirnov
2018-02-20 7:03 ` Jan Kiszka
2018-02-20 8:18 ` Claudius Heine
2018-02-16 8:52 ` [PATCH 2/8] isar-events: Wait for failing umounts Jan Kiszka
2018-02-19 9:45 ` Alexander Smirnov
2018-02-19 9:48 ` Jan Kiszka [this message]
2018-02-19 10:03 ` Alexander Smirnov
2018-02-19 11:10 ` Jan Kiszka
2018-02-16 8:52 ` [PATCH 3/8] isar-events: Do not match on distro and arch Jan Kiszka
2018-02-19 9:54 ` Alexander Smirnov
2018-02-19 11:08 ` Jan Kiszka
2018-02-16 8:52 ` [PATCH 4/8] Add Debian arm64 support to the core Jan Kiszka
2018-02-16 8:52 ` [PATCH 5/8] Add qemuarm64-stretch multiconfig Jan Kiszka
2018-02-19 10:23 ` Alexander Smirnov
2018-02-19 11:15 ` Jan Kiszka
2018-02-19 12:19 ` Alexander Smirnov
2018-02-19 12:36 ` Jan Kiszka
2018-02-16 8:52 ` [PATCH 6/8] Add qemuarm64-stretch to CI Jan Kiszka
2018-02-16 8:52 ` [PATCH 7/8] build-kernel.sh: Add copyright header Jan Kiszka
2018-02-16 8:52 ` [PATCH 8/8] Enhance credits Jan Kiszka
2018-02-19 13:56 ` [PATCH 0/8] Assorted patches Alexander Smirnov
2018-02-19 14:08 ` Jan Kiszka
2018-02-19 14:19 ` Alexander Smirnov
2018-02-20 11:19 ` Alexander Smirnov
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=70af17d0-be54-60c6-a11f-0a5047abea33@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