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

Unified Diff: infra_libs/ts_mon/common/monitors.py

Issue 1510753002: Set a 10 second socket timeout on ts_mon pubsub requests (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 5 years 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: infra_libs/ts_mon/common/monitors.py
diff --git a/infra_libs/ts_mon/common/monitors.py b/infra_libs/ts_mon/common/monitors.py
index f3c3bb8a7d60f584a26ce9b2dd04f99f2597d50d..eb2433fb043950a38051eb95d96429d0a97a4a65 100644
--- a/infra_libs/ts_mon/common/monitors.py
+++ b/infra_libs/ts_mon/common/monitors.py
@@ -64,6 +64,8 @@ class PubSubMonitor(Monitor):
'https://www.googleapis.com/auth/pubsub',
]
+ TIMEOUT = 10 # seconds
+
def _load_credentials(self, credentials_file_path):
if credentials_file_path == GCE_CREDENTIALS:
return gce.AppAssertionCredentials(self._SCOPES)
@@ -120,9 +122,10 @@ class PubSubMonitor(Monitor):
self._api = None
self._use_instrumented_http = use_instrumented_http
if use_instrumented_http:
- self._http = httplib2_utils.InstrumentedHttp('acq-mon-api-pubsub')
+ self._http = httplib2_utils.InstrumentedHttp(
+ 'acq-mon-api-pubsub', timeout=self.TIMEOUT)
else:
- self._http = httplib2.Http()
+ self._http = httplib2.Http(timeout=self.TIMEOUT)
self._credsfile = credsfile
self._topic = 'projects/%s/topics/%s' % (project, topic)
self._check_initialize()
« 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