log-gearman-worker: Remove jenkins streaming workaround

We don't need to worry about the file changing under us any more; this
was all pre-zuul, let alone pre-using-swift for logs.  Remove this
workaround.

Change-Id: I5938dcef5550d4c62c8158c5f89ace75ae99aedc
This commit is contained in:
Ian Wienand 2019-08-19 12:25:52 +10:00
parent bca04e3155
commit 5b30a3a6c0
1 changed files with 0 additions and 31 deletions

View File

@ -317,37 +317,6 @@ class LogRetriever(threading.Thread):
encoding = 'deflate'
raw_buf = r.read()
# Hack to read all of Jenkins console logs as they upload
# asynchronously. After each attempt do an exponential backup before
# the next request for up to 255 seconds total, if we do not
# retrieve the entire file. Short circuit when the end of file string
# for console logs, '\n</pre>\n', is read.
if (retry and not encoding == 'gzip' and
raw_buf[-8:].decode('utf-8') != '\n</pre>\n'):
content_len = len(raw_buf)
backoff = 1
while backoff < 129:
# Try for up to 255 seconds to retrieve the complete log file.
try:
logging.debug(str(backoff) + " Retrying fetch of: " +
source_url + "?level=INFO")
logging.debug("Fetching bytes=" + str(content_len) + '-')
req = urllib2.Request(source_url + "?level=INFO")
req.add_header('Range', 'bytes=' + str(content_len) + '-')
r = urllib2.urlopen(req)
raw_buf += r.read()
content_len = len(raw_buf)
except urllib2.HTTPError as e:
if e.code == 416:
logging.exception("Index out of range.")
else:
raise
finally:
if raw_buf[-8:].decode('utf-8') == '\n</pre>\n':
break
semi_busy_wait(backoff)
backoff += backoff
return encoding, raw_buf