supervisor+uwsgi+django遇到writing to a closed pipe/socket/fd解决

缘由:html

最近开发的一个项目,因为有个更新job须要消耗的时间很是长,一度觉得更新出现了错误。socket

 

通过:测试

因而打开debug模式测试, 异常开启,调试发现system返回了debug

writing to a closed pipe/socket/fd (probably the client disconnected) !!!调试

异常返回IO write()异常了htm

具体信息以下:接口

uwsgi_response_writev_headers_and_body_do(): Broken pipe [core/writer.c line 296]ip

能够看出uwsgi的pipe broken掉了,由于只是接口,uwsgi default 60秒开发

因此实际上是超时了uwsgi认为这个pipe clinet已经断开,uwsgi还在run,当job超过了60秒,就把他干掉了。it

 

解决:

修改uwsgin.ini,增长http-time设置便可

https://uwsgi-docs.readthedocs.io/en/latest/Options.html#http-timeout

相关文章
相关标签/搜索