Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Unified Diff: client/utils/subprocess42.py

Issue 1373133004: Fixes and add smoke test: hard timeout on isolated task. (Closed) Base URL: git@github.com:luci/luci-py.git@master
Patch Set: . Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/utils/logging_utils.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/utils/subprocess42.py
diff --git a/client/utils/subprocess42.py b/client/utils/subprocess42.py
index ef82dcdf70e49d7087f27d20b1456ddca99c8ce8..ad56bdb010996b76af66b53c7936463723b506b1 100644
--- a/client/utils/subprocess42.py
+++ b/client/utils/subprocess42.py
@@ -454,8 +454,11 @@ def set_signal_handler(signals, handler):
@contextlib.contextmanager
def Popen_with_handler(args, **kwargs):
proc = None
- def handler(_signum, _frame):
+ def handler(signum, _frame):
if proc:
+ logging.info('Received signal %d; terminating', signum)
+ # There could be a race condition where the process already exited. Our
+ # subprocess implementation traps this.
proc.terminate()
with set_signal_handler(STOP_SIGNALS, handler):
« no previous file with comments | « client/utils/logging_utils.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698