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

bug: request fails in metrics middleware handling of streamed response #396

Closed
edaniszewski opened this issue Jun 24, 2020 · 1 comment · Fixed by #397
Closed

bug: request fails in metrics middleware handling of streamed response #396

edaniszewski opened this issue Jun 24, 2020 · 1 comment · Fixed by #397
Assignees
Labels

Comments

@edaniszewski
Copy link
Contributor

bug noticed by @lazypower

When the read_cache endpoint is hit, it returns data as a stream, but the response middleware used to collect app metrics for synse-server apparently is failing to handle streamed responses correctly

timestamp='2020-06-24T15:02:46.466188Z' logger='sanic.error' level='error' event='Exception occurred in one of response middleware handlers' request_id='6Va5Toht4R3crknzJ6ue2o' exception='Traceback (most recent call last):\n  File "/usr/local/lib/python3.8/site-packages/sanic/app.py", line 1016, in handle_request\n    response = await self._run_response_middleware(\n  File "/usr/local/lib/python3.8/site-packages/sanic/app.py", line 1313, in _run_response_middleware\n    _response = middleware(request, response)\n  File "/usr/local/lib/python3.8/site-packages/synse_server/app.py", line 77, in on_response\n    bytes=len(response.body),\nAttributeError: \'StreamingHTTPResponse\' object has no attribute \'body\''

A check should be added for this case, as well as regression test case(s).

@edaniszewski edaniszewski self-assigned this Jun 24, 2020
@edaniszewski
Copy link
Contributor Author

This isn't actually with the metrics middleware as I originally thought, but with another middleware function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant