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

Unified Diff: infra/services/service_manager/config_watcher.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/config_watcher.py
diff --git a/infra/services/service_manager/config_watcher.py b/infra/services/service_manager/config_watcher.py
index eb5d1fe81039566c3086c9702cebbd881a0c531f..fb4f4d0bceee0f0f276c7fb247e7ef38b98b657c 100644
--- a/infra/services/service_manager/config_watcher.py
+++ b/infra/services/service_manager/config_watcher.py
@@ -33,6 +33,7 @@ class ConfigWatcher(object):
def __init__(self, config_directory, config_poll_interval,
service_poll_interval, state_directory, root_directory,
+ cloudtail_path,
sleep_fn=time.sleep):
"""
Args:
@@ -43,12 +44,15 @@ class ConfigWatcher(object):
state_directory: A file will be created in this directory (with the same
name as the service) when it is running containing its PID and
starttime.
+ cloudtail_path: Path to the cloudtail binary to use for logging, or None
+ if logging is disabled.
"""
self._config_glob = os.path.join(config_directory, '*.json')
self._config_poll_interval = config_poll_interval
self._service_poll_interval = service_poll_interval
self._state_directory = state_directory
+ self._cloudtail_path = cloudtail_path
self._metadata = {} # Filename -> _Metadata
self._services = {} # Service name -> Filename
@@ -133,7 +137,8 @@ class ConfigWatcher(object):
thread = service_thread.ServiceThread(
self._service_poll_interval,
self._state_directory,
- config)
+ config,
+ self._cloudtail_path)
thread.start()
thread.start_service()
self._metadata[filename] = _Metadata(mtime, config, thread)
@@ -165,7 +170,8 @@ class ConfigWatcher(object):
metadata.thread = service_thread.ServiceThread(
self._service_poll_interval,
self._state_directory,
- metadata.config)
+ metadata.config,
+ self._cloudtail_path)
metadata.thread.start()
metadata.thread.start_service()
else:

Powered by Google App Engine
This is Rietveld 408576698