Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scrapy: searching backtrace with gzip #1931

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions teuthology/scrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import difflib
from errno import ENOENT
from gzip import GzipFile
import gzip
import sys
import os
import yaml
Expand Down Expand Up @@ -356,6 +356,8 @@ def _populate_backtrace(self):
return

for line in grep(tlog_path, "command crashed with signal"):
if not line:
continue
log.debug("Found a crash indication: {0}".format(line))
# tasks.ceph.osd.1.plana82.stderr
match = re.search(r"tasks.ceph.([^\.]+).([^\.]+).([^\.]+).stderr", line)
Expand All @@ -382,7 +384,10 @@ def _populate_backtrace(self):
))
continue

bt, ass = self._search_backtrace(GzipFile(gzipped_log_path))
with gzip.open(gzipped_log_path, 'rb') as f:
# Read and decode the contents into strings
decoded_content = f.read().decode('utf-8')
bt, ass = self._search_backtrace(decoded_content)
if ass and not self.assertion:
self.assertion = ass
if bt:
Expand Down