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

bugfix: cannot get response size from body attr for streamed responses #344

Merged
merged 1 commit into from
Nov 7, 2019

Conversation

edaniszewski
Copy link
Contributor

This PR:

  • fixes a bug in the metrics collection where streamed responses will raise an exception due to the streamed response not having a body attribute
timestamp='2019-11-07T19:25:23.740522Z' level='debug' event='processing request' method='GET' ip='10.48.29.113' path='/v3/readcache' params={'start': ['2019-11-07T19:25:18Z']}
Exception occurred in one of response middleware handlers
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/sanic/app.py", line 983, in handle_request
    request, response
  File "/usr/local/lib/python3.6/site-packages/sanic/app.py", line 1271, in _run_response_middleware
    _response = await _response
  File "/usr/local/lib/python3.6/site-packages/synse_server/metrics.py", line 118, in before_response
    if response.body is not None:
AttributeError: 'StreamingHTTPResponse' object has no attribute 'body'

Copy link
Contributor

@KylerBurke KylerBurke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@edaniszewski edaniszewski merged commit 92a364f into v3/staging Nov 7, 2019
@edaniszewski edaniszewski deleted the middleware-err branch November 7, 2019 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants