Gunicorn RecursionError与gevent和python中的请求3.6.2

问题描述:

我有一个简单的flask脚本,它使用请求向第三方web服务发出http请求。我在gunicorn运行脚本的方式是Gunicorn RecursionError与gevent和python中的请求3.6.2

gunicorn abc:APP -b 0.0.0.0:8080 -w 4 -k gevent --timeout 30 --preload

然而,当我升级代码到Python 3.6.2,我仍然可以运行服务器,但每当网络服务器收到请求时,它显示

RecursionError: maximum recursion depth exceeded while calling a Python object

对每个工人,并且服务器似乎仍在运行。当我改变运行命令

gunicorn abc:APP -b 0.0.0.0:8080 -w 4 --timeout 30 --preload

这一切再次工作。那么在python 3.6.2中,gunicorn的异步工作者和请求有什么问题吗?有没有办法来解决这个问题?

(这个问题还要求在https://github.com/benoitc/gunicorn/issues/1559

+0

什么版本的gevent?它会受到这个影响吗? https://github.com/gevent/gevent/issues/903 – gred

请参阅https://github.com/benoitc/gunicorn/issues/1559。这可能会在下一个版本的gunicorn中修复,但不幸的是,如果你不想打破gunicorn,那么你可能不得不继续使用python 3.5.2。