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

Unified Diff: infra/services/service_manager/service_thread.py

Issue 1365583002: Have service_manager start a cloudtail attached to each service it starts. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Just use the default project ID 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
Index: infra/services/service_manager/service_thread.py
diff --git a/infra/services/service_manager/service_thread.py b/infra/services/service_manager/service_thread.py
index 5d922bca0c9495e91e7b4fe8c32428514f7664dc..a24abf8876fdc3d8f1fabe245e40cdfe3af31e4e 100644
--- a/infra/services/service_manager/service_thread.py
+++ b/infra/services/service_manager/service_thread.py
@@ -41,6 +41,7 @@ class ServiceThread(threading.Thread):
upgrades = ts_mon.CounterMetric('service_manager/upgrades')
def __init__(self, poll_interval, state_directory, service_config,
+ cloudtail_path,
wait_condition=None):
"""
Args:
@@ -50,6 +51,8 @@ class ServiceThread(threading.Thread):
starttime.
service_config: A dictionary containing the service's config. See README
for a description of the fields.
+ cloudtail_path: Path to the cloudtail binary to use for logging, or None
+ if logging is disabled.
"""
super(ServiceThread, self).__init__()
@@ -59,7 +62,10 @@ class ServiceThread(threading.Thread):
self._poll_interval = poll_interval
self._state_directory = state_directory
- self._service = service.Service(state_directory, service_config)
+ self._cloudtail_path = cloudtail_path
+ self._service = service.Service(self._state_directory,
+ service_config,
+ self._cloudtail_path)
self._condition = wait_condition # Protects _state.
self._state = _State() # _condition must be held.
@@ -98,8 +104,9 @@ class ServiceThread(threading.Thread):
# Recreate it with the new config and start it.
self.reconfigs.increment(fields={'service': self._service.name})
- self._service = service.Service(
- self._state_directory, state.new_config)
+ self._service = service.Service(self._state_directory,
+ state.new_config,
+ self._cloudtail_path)
self._service.start()
self._started = True
elif state.should_run == False:

Powered by Google App Engine
This is Rietveld 408576698