diff options
author | ToshikazuOhiwa <toshikazu_ohiwa@mail.toyota.co.jp> | 2020-03-30 09:24:26 +0900 |
---|---|---|
committer | ToshikazuOhiwa <toshikazu_ohiwa@mail.toyota.co.jp> | 2020-03-30 09:24:26 +0900 |
commit | 5b80bfd7bffd4c20d80b7c70a7130529e9a755dd (patch) | |
tree | b4bb18dcd1487dbf1ea8127e5671b7bb2eded033 /external/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0005-fix-incorrect-timeout-while-system-time-changed.patch | |
parent | 706ad73eb02caf8532deaf5d38995bd258725cb8 (diff) |
agl-basesystem
Diffstat (limited to 'external/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0005-fix-incorrect-timeout-while-system-time-changed.patch')
-rw-r--r-- | external/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0005-fix-incorrect-timeout-while-system-time-changed.patch | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/external/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0005-fix-incorrect-timeout-while-system-time-changed.patch b/external/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0005-fix-incorrect-timeout-while-system-time-changed.patch new file mode 100644 index 00000000..ecb95039 --- /dev/null +++ b/external/meta-openembedded/meta-python/recipes-extended/python-blivet/python3-blivet/0005-fix-incorrect-timeout-while-system-time-changed.patch @@ -0,0 +1,48 @@ +From b30a74671ca603e6bfd514f72d4fd7fd6fceef54 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Fri, 26 Aug 2016 02:02:49 -0400 +Subject: [PATCH 05/11] fix incorrect timeout while system time changed + +While system time changed by NTP, invoking timeout_command +breaks with incorrect timeout. +-------- +|05:40:55,872 INFO program: Running... mount -t ext2 -o + defaults,ro /dev/sda2 /mnt/sysimage +|01:40:55,086 DEBUG program: 10 seconds timeout +-------- + +Use numbert count to replace current time count could workaround +the issue. + +Upstream-Status: Pending + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +--- + blivet/util.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/blivet/util.py b/blivet/util.py +index d6804be..bc08af5 100644 +--- a/blivet/util.py ++++ b/blivet/util.py +@@ -162,14 +162,14 @@ def timeout_command(argv, timeout, *args, **kwargs): + """call shell-command and either return its output or kill it + if it doesn't normally exit within timeout seconds and return None""" + import subprocess, datetime, os, time, signal +- start = datetime.datetime.now() ++ count = 0 + + try: + proc = subprocess.Popen(argv, *args, **kwargs) + while proc.poll() is None: + time.sleep(0.1) +- now = datetime.datetime.now() +- if timeout != -1 and (now - start).seconds> timeout: ++ count += 1 ++ if timeout != -1 and count > timeout*10: + os.kill(proc.pid, signal.SIGKILL) + os.waitpid(-1, os.WNOHANG) + program_log.debug("%d seconds timeout" % timeout) +-- +2.7.4 + |