-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Fixes write_error loop from bail_out function #309
Conversation
Fixes stack-overflow found in sanic-org#307
if self.transport.is_closing(): | ||
log.error( | ||
"Connection closed before error was sent to user @ {}".format( | ||
self.transport.get_extra_info('peername'))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can use the property hereself.request.ip
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well in the example that we had seen from the issue self.parser was still None so I'd be wary of if self.request was filled out correctly as well. It's just a safe way of doing it.
@seemethere I was going to use another try/except here, and just log in the exception, instead of trying to write. Are there any other exceptions that could occur during |
I would also think a try/except would be faster than checking the |
You might need to run it through wrk to replicate the issue. |
I saw almost no benefit to using try/except instead, so let's use this for now. |
Fixes stack-overflow found in #307