From 1efe7c7e7bdef77ade4478bbaed4211aa178caaa Mon Sep 17 00:00:00 2001 From: Josip Sokcevic Date: Tue, 19 Oct 2021 20:58:33 +0000 Subject: [PATCH] Use sigkill instead of sigterm on a stale process Only hanging process recorded so far is gsutil. Sending sigterm doesn't result in successfully terminating the process. Instead, use sigkill. R=gavinmak@google.com Bug: 1255228 Change-Id: Iad354284422676df804c68cb6f18c7db723bf862 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3232250 Auto-Submit: Josip Sokcevic Reviewed-by: Gavin Mak Commit-Queue: Gavin Mak --- recipes/recipe_modules/bot_update/resources/bot_update.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes/recipe_modules/bot_update/resources/bot_update.py b/recipes/recipe_modules/bot_update/resources/bot_update.py index a427f948e..894cbcb8c 100755 --- a/recipes/recipe_modules/bot_update/resources/bot_update.py +++ b/recipes/recipe_modules/bot_update/resources/bot_update.py @@ -165,9 +165,9 @@ def _print_pstree(): subprocess.call(['ps', 'auxwwf']) -def _terminate_process(proc): - print('Terminating stale process...') - proc.terminate() +def _kill_process(proc): + print('Killing stale process...') + proc.kill() # TODO(crbug.com/1227140): Clean up when py2 is no longer supported. @@ -205,7 +205,7 @@ def call(*args, **kwargs): # pragma: no cover proc = subprocess.Popen(args, **kwargs) observers = [ RepeatingTimer(300, _print_pstree), - RepeatingTimer(int(stale_process_duration), _terminate_process, [proc])] + RepeatingTimer(int(stale_process_duration), _kill_process, [proc])] for observer in observers: observer.start()