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

Unified Diff: third_party/buildbot_slave_8_4/buildslave/runprocess.py

Issue 325963006: Kill builds that produce too much output (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 6 years, 6 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 | « third_party/buildbot_slave_8_4/README.chromium ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/buildbot_slave_8_4/buildslave/runprocess.py
diff --git a/third_party/buildbot_slave_8_4/buildslave/runprocess.py b/third_party/buildbot_slave_8_4/buildslave/runprocess.py
index 6a96b03ed9d3a4c6571ee9b83ff6ce6805eaa2c0..1b79a176a9ae87ac7e9301cda168fa9ec61f8011 100644
--- a/third_party/buildbot_slave_8_4/buildslave/runprocess.py
+++ b/third_party/buildbot_slave_8_4/buildslave/runprocess.py
@@ -212,6 +212,7 @@ class RunProcess:
BACKUP_TIMEOUT = 5
KILL = "KILL"
CHUNK_LIMIT = 128*1024
+ OUTPUT_LIMIT = 50*1024*1024
cmp 2014/06/10 15:51:22 Add an inline comment ("Limit is 50 MB.") Did you
# Don't send any data until at least BUFFER_SIZE bytes have been collected
# or BUFFER_TIMEOUT elapsed
@@ -322,6 +323,7 @@ class RunProcess:
self.buffered = deque()
self.buflen = 0
self.buftimer = None
+ self.totalOutputLength = 0
if usePTY == "slave-config":
self.usePTY = self.builder.usePTY
@@ -621,6 +623,11 @@ class RunProcess:
"""
n = len(data)
+ self.totalOutputLength += n
+ if self.totalOutputLength > self.OUTPUT_LIMIT:
+ self.kill('output limit (%d) exceeded' % self.OUTPUT_LIMIT)
+ return
+
self.buflen += n
self.buffered.append((logname, data))
if self.buflen > self.BUFFER_SIZE:
« no previous file with comments | « third_party/buildbot_slave_8_4/README.chromium ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698