-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
prevent crash when reporting an error #1231
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Try to not crash when reporting an error. This changes makes sure we can log the uri and also handle SSL errors. fix #1177
please review. cc @tilgovi @berkerpeksag |
LGTM. A minor comment: |
@berkerpeksag thanks! I guess we should do that for all similar messages. Let's do that in another commit if needed :) |
benoitc
added a commit
that referenced
this pull request
Mar 22, 2016
prevent crash when reporting an error
wking
added a commit
to wking/gunicorn
that referenced
this pull request
Nov 3, 2017
This makes it a bit easier to debug than just logging the fact that there was an exception. Also restore logging in the URI-less case, since that was broken in 79011d0 (Include request URL in error message, 2015-07-08, benoitc#1071) but not restored in 1ccebab (prevent crash when reporting an error, 2016-03-22, benoitc#1231).
wking
added a commit
to wking/gunicorn
that referenced
this pull request
Nov 3, 2017
This makes it a bit easier to debug than just logging the fact that there was an exception. Also restore logging in the URI-less case, since that was broken in 79011d0 (Include request URL in error message, 2015-07-08, benoitc#1071) but not restored in 1ccebab (prevent crash when reporting an error, 2016-03-22, benoitc#1231).
wking
added a commit
to wking/gunicorn
that referenced
this pull request
Nov 3, 2017
The argument is documented in [1], and we've been using it in some cases since 410bcfa (Fix statsd logging to work on Python 3, 2015-04-20, benoitc#1010). This commit goes through all of our log calls and makes sure we're using it consistently. For more examples of using exc_info instead of direct traceback calls, see 0acfb55 (Let logging module handle traceback printing, 2016-02-05, benoitc#1201). The traceback call I'm removing snuck in later with f4842a5 (Log exception occurring during worker exit, 2016-05-04, benoitc#1254). I'm removing the "Error processing SSL request" debug messages, because those will be handled by the subsequent handle_error call. We've had them, for reasons that I'm not clear on, since 1198cc2 (handle ssl connections, 2012-12-14). I've restored logging in the URI-less Worker.handle_error 500 case, since that was broken in 79011d0 (Include request URL in error message, 2015-07-08, benoitc#1071) but not restored in 1ccebab (prevent crash when reporting an error, 2016-03-22, benoitc#1231). [1]: https://docs.python.org/2/library/logging.html#logging.Logger.debug
wking
added a commit
to wking/gunicorn
that referenced
this pull request
Nov 3, 2017
The argument is documented in [1], and we've been using it in some cases since 410bcfa (Fix statsd logging to work on Python 3, 2015-04-20, benoitc#1010). This commit goes through all of our log calls and makes sure we're using it consistently. For more examples of using exc_info instead of direct traceback calls, see 0acfb55 (Let logging module handle traceback printing, 2016-02-05, benoitc#1201). The traceback call I'm removing snuck in later with f4842a5 (Log exception occurring during worker exit, 2016-05-04, benoitc#1254). I'm removing the "Error processing SSL request" debug messages, because those will be handled by the subsequent handle_error call. We've had them, for reasons that I'm not clear on, since 1198cc2 (handle ssl connections, 2012-12-14). I've restored logging in the URI-less Worker.handle_error 500 case, since that was broken in 79011d0 (Include request URL in error message, 2015-07-08, benoitc#1071) but not restored in 1ccebab (prevent crash when reporting an error, 2016-03-22, benoitc#1231). Tests for the lines I've touched may be more trouble than they're worth. I've worked up one for a broken worker_exit hook to show what they look like, but left the others untested for now. [1]: https://docs.python.org/2/library/logging.html#logging.Logger.debug
wking
added a commit
to wking/gunicorn
that referenced
this pull request
Nov 3, 2017
The argument is documented in [1], and we've been using it in some cases since 410bcfa (Fix statsd logging to work on Python 3, 2015-04-20, benoitc#1010). This commit goes through all of our log calls and makes sure we're using it consistently. For more examples of using exc_info instead of direct traceback calls, see 0acfb55 (Let logging module handle traceback printing, 2016-02-05, benoitc#1201). The traceback call I'm removing snuck in later with f4842a5 (Log exception occurring during worker exit, 2016-05-04, benoitc#1254). I'm removing the "Error processing SSL request" debug messages, because those will be handled by the subsequent handle_error call. We've had them, for reasons that I'm not clear on, since 1198cc2 (handle ssl connections, 2012-12-14). I've restored logging in the URI-less Worker.handle_error 500 case, since that was broken in 79011d0 (Include request URL in error message, 2015-07-08, benoitc#1071) but not restored in 1ccebab (prevent crash when reporting an error, 2016-03-22, benoitc#1231). Tests for the lines I've touched may be more trouble than they're worth. I've worked up one for a broken worker_exit hook to show what they look like, but left the others untested for now. [1]: https://docs.python.org/2/library/logging.html#logging.Logger.debug
mjjbell
pushed a commit
to mjjbell/gunicorn
that referenced
this pull request
Mar 16, 2018
prevent crash when reporting an error
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Try to not crash when reporting an error. This changes makes sure we can log the uri and also handle SSL errors.
fix #1177