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

Unified Diff: trunk/src/tools/telemetry/telemetry/util/global_hooks.py

Issue 310083009: Revert 274036 "[Telemetry] Terminate any dangling subprocesses" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/tools/telemetry/telemetry/util/global_hooks.py
===================================================================
--- trunk/src/tools/telemetry/telemetry/util/global_hooks.py (revision 274705)
+++ trunk/src/tools/telemetry/telemetry/util/global_hooks.py (working copy)
@@ -4,12 +4,10 @@
"""Hooks that apply globally to all scripts that import or use Telemetry."""
-import atexit
import os
import signal
import sys
-from telemetry.core import platform
from telemetry.core import util
from telemetry.util import exception_formatter
@@ -20,7 +18,6 @@
InstallUnhandledExceptionFormatter()
InstallStackDumpOnSigusr1()
InstallTerminationHook()
- InstallAtExitHook()
def RemoveAllStalePycFiles(base_dir):
@@ -74,24 +71,3 @@
exception_formatter.PrintFormattedFrame(stack_frame, exception_string)
sys.exit(-1)
signal.signal(signal.SIGTERM, PrintStackAndExit)
-
-
-def InstallAtExitHook():
- """Ensure all subprocesses are killed.
-
- Subprocesses should never outlive Telemetry. If they do, they can cause
- hangs on the builbots.
- """
- # TODO(tonyg): Find a way to do something similar on Windows.
- if platform.GetHostPlatform().GetOSName() == 'win':
- return
-
- # Create new process group and become its leader.
- os.setpgrp()
-
- # At exit, terminate everything in the group.
- def KillGroup():
- # Ignore the TERM we're about to get.
- signal.signal(signal.SIGTERM, signal.SIG_IGN)
- os.killpg(0, signal.SIGTERM)
- atexit.register(KillGroup)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698