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

Unified Diff: scripts/slave/recipe_modules/goma/api.py

Issue 2375843005: Stop redirect stdout/stderr and remove close_fds=True (Closed)
Patch Set: add comment Created 4 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
Index: scripts/slave/recipe_modules/goma/api.py
diff --git a/scripts/slave/recipe_modules/goma/api.py b/scripts/slave/recipe_modules/goma/api.py
index 7844de454e2328f47d9a0027cc5423b5d8a092ea..13095e7aba1fa7edff31a465e27b1353b5796701 100644
--- a/scripts/slave/recipe_modules/goma/api.py
+++ b/scripts/slave/recipe_modules/goma/api.py
@@ -15,7 +15,6 @@ class GomaApi(recipe_api.RecipeApi):
self._goma_started = False
self._goma_ctl_env = {}
- self._cloudtail_pid = None
self._goma_jobs = None
@property
@@ -30,6 +29,10 @@ class GomaApi(recipe_api.RecipeApi):
return self.m.path.join(self._goma_dir, 'cloudtail')
@property
+ def cloudtail_pid_file(self):
+ return self.m.path['tmp_base'].join('cloudtail.pid')
+
+ @property
def json_path(self):
assert self._goma_dir
return self.m.path.join(self._goma_dir, 'jsonstatus')
@@ -133,21 +136,18 @@ print jobs
InfraFailure if it fails to start cloudtail
"""
- assert self._cloudtail_pid is None
-
- step_result = self.m.python(
+ self.m.python(
name='start cloudtail',
script=self.resource('cloudtail_utils.py'),
args=['start',
- '--cloudtail-path', self.cloudtail_path],
+ '--cloudtail-path', self.cloudtail_path,
+ '--pid-file', self.m.raw_io.output(
+ leak_to=self.cloudtail_pid_file)],
env=self._goma_ctl_env,
- stdout=self.m.raw_io.output(),
step_test_data=(
- lambda: self.m.raw_io.test_api.stream_output('12345')),
+ lambda: self.m.raw_io.test_api.output('12345')),
infra_step=True)
- self._cloudtail_pid = step_result.stdout
-
def _stop_cloudtail(self):
"""Stop cloudtail started by _start_cloudtail
@@ -155,17 +155,13 @@ print jobs
InfraFailure if it fails to stop cloudtail
"""
- assert self._cloudtail_pid is not None
-
self.m.python(
name='stop cloudtail',
script=self.resource('cloudtail_utils.py'),
args=['stop',
- '--killed-pid', self._cloudtail_pid],
+ '--killed-pid-file', self.cloudtail_pid_file],
infra_step=True)
- self._cloudtail_pid = None
-
def start(self, env=None, **kwargs):
"""Start goma compiler_proxy.

Powered by Google App Engine
This is Rietveld 408576698