Gunicorn exits because https request from Django f

2019-04-12 04:30发布

Here's the scenario. I have a Django app being served by Gunicorn on Linux. On certain requests it makes an https call to an external API via httplib2.request(). Sometimes that call fails in such a way that hoses OpenSSL (not sure how, but it's not my fault and doesn't really matter). OpenSSL sends a SIGABRT signal to gunicorn in this case. Gunicorn handles the SIGABRT and promptly system exits (as it should).

The root issue as I see it is that OpenSSL asynchronously signals the parent process to abort, rather than returning an error code. Don't tell me to abort because of YOUR personal problems, OpenSSL! Legacy code in action.

Is anyone else thoroughly annoyed by this problem? How would you prevent this from killing your Gunicorn process? It completely bypasses Django exception handling.

Relevant code points:

0条回答
登录 后发表回答