Merge "Add warn level logging if we hit un-recoverable EC rebuild"

This commit is contained in:
Zuul
2021-06-12 07:06:11 +00:00
committed by Gerrit Code Review
2 changed files with 17 additions and 5 deletions

View File

@@ -1438,7 +1438,13 @@ class ECAppIter(object):
# with an un-reconstructible list of fragments - so we'll
# break out of the iter so WSGI can tear down the broken
# connection.
if not all(fragments):
frags_with_data = sum([1 for f in fragments if f])
if frags_with_data < len(fragments):
if frags_with_data > 0:
self.logger.warning(
'Un-recoverable fragment rebuild. Only received '
'%d/%d fragments for %r', frags_with_data,
len(fragments), quote(self.path))
break
try:
segment = self.policy.pyeclib_driver.decode(fragments)

View File

@@ -4930,7 +4930,13 @@ class TestECObjController(ECObjectControllerMixin, unittest.TestCase):
self.assertEqual(2, len(error_lines))
self.assertIn('Unable to fast forward', error_lines[0])
self.assertIn('Timeout fetching', error_lines[1])
for line in self.logger.logger.records['ERROR']:
warning_lines = self.logger.get_lines_for_level('warning')
self.assertEqual(1, len(warning_lines))
self.assertIn(
'Un-recoverable fragment rebuild. Only received 9/10 fragments',
warning_lines[0])
for line in self.logger.logger.records['ERROR'] + \
self.logger.logger.records['WARNING']:
self.assertIn(req.headers['x-trans-id'], line)
def test_GET_read_timeout_resume_mixed_etag(self):