-
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
Unhandled BaseException cause upstrream connection disconnected sliently #2923
Comments
thanks for the patch even if you just closed it. I will apply it so we can catcg all exceptions under python 3. |
Welcome, I deleted my forked repo without expecting this PR to be closed there. Glad to see this change has been merged! |
jeffesp
pushed a commit
to datarobot-forks/gunicorn-drfork
that referenced
this issue
Oct 2, 2024
ensure we can catch correctly exceptions based on BaseException. Note: patch was origninally proposed by the pr benoitc#2923, but original author closed it. Fix benoitc#2923
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Context
If Gunicron is configured with
keepalive
!= 0, thenbase_async.py
will handle it with keepalive loop.Here when using worker type as:
worker_class = "gevent"
, then gevent.py defined as:This logic will throw out
gevent.Timeout
type when timeout and our logic cannot handle that in all different kinds of exception logic until getting to the final branch: https://github.com/benoitc/gunicorn/blob/master/gunicorn/workers/base_async.py#L87Because:
Impact
This will be a problem as a connection between the gateway (eg: Nginx) and Gunicorn will be suddenly closed without response and Nginx will expect the service was died and return back clients with error 502.
From Nginx you will see something that is not reasonable like:
The error can also be triggered when throwing out any other exception that is not inherited from Exception but BaseException from user logic in Flask app.
The text was updated successfully, but these errors were encountered: