Merge "slo: 500 if we can't load the manifest"
This commit is contained in:
commit
957743f25f
@ -942,7 +942,7 @@ class SloGetContext(WSGIContext):
|
||||
try:
|
||||
segments = json.loads(resp_body)
|
||||
except ValueError:
|
||||
segments = []
|
||||
raise HTTPServerError('Unable to load SLO manifest')
|
||||
|
||||
return segments
|
||||
|
||||
|
@ -3324,10 +3324,14 @@ class TestSloGetManifest(SloTestCase):
|
||||
status, headers, body = self.call_slo(req)
|
||||
headers = HeaderKeyDict(headers)
|
||||
|
||||
self.assertEqual(status, '200 OK')
|
||||
self.assertEqual(headers['Content-Length'], '0')
|
||||
self.assertEqual(headers['X-Object-Meta-Fish'], 'Bass')
|
||||
self.assertEqual(body, b'')
|
||||
# This often (usually?) happens because of an incomplete read -- the
|
||||
# proxy app started getting a large manifest and sending it back to
|
||||
# SLO, then there was a timeout or something, couldn't resume in time,
|
||||
# and we've got just part of a JSON document. Having the client retry
|
||||
# seems reasonable
|
||||
self.assertEqual(status, '500 Internal Error')
|
||||
self.assertEqual(body, b'Unable to load SLO manifest')
|
||||
self.assertNotIn('X-Object-Meta-Fish', headers)
|
||||
|
||||
def _do_test_generator_closure(self, leaks):
|
||||
# Test that the SLO WSGI iterable closes its internal .app_iter when
|
||||
|
Loading…
x
Reference in New Issue
Block a user