From d70aa16fd5af125fae7a397311b7ae1bee955c84 Mon Sep 17 00:00:00 2001 From: Josip Sokcevic Date: Tue, 28 Apr 2020 17:07:08 +0000 Subject: [PATCH] Reland "Print ps in intervals while the process is running" This is a reland of 50c6d8d348bc160854e64de821052da79bdbd483 Original change's description: > Print ps in intervals while the process is running > > R=apolito@google.com, ehmaldonado@chromium.org > > Bug: 1074355 > Change-Id: Id2d5c8ca6f27fefb0fe8d769ae2e50dbaaddadbb > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2167221 > Reviewed-by: Edward Lesmes > Reviewed-by: Anthony Polito > Commit-Queue: Josip Sokcevic R=apolito@google.com, ehmaldonado@chromium.org Bug: 1074355 Change-Id: I488b521e4a3b859c37f0bb1e21cad7d037f8f97e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2169392 Reviewed-by: Edward Lesmes Commit-Queue: Josip Sokcevic --- .../recipe_modules/bot_update/resources/bot_update.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/recipes/recipe_modules/bot_update/resources/bot_update.py b/recipes/recipe_modules/bot_update/resources/bot_update.py index 4561c67c3b..7b1a51c057 100755 --- a/recipes/recipe_modules/bot_update/resources/bot_update.py +++ b/recipes/recipe_modules/bot_update/resources/bot_update.py @@ -117,11 +117,16 @@ class PsPrinter(object): self.active = sys.platform.startswith('linux2') self.thread = None - @staticmethod - def print_pstree(): + def print_pstree(self): """Debugging function used to print "ps auxwwf" for stuck processes.""" + # Add new line for cleaner output + print() subprocess.call(['ps', 'auxwwf']) + # Restart timer, we want to continue printing until the process is + # terminated. + self.poke() + def poke(self): if self.active: self.cancel()