uWSGI/Django Error Log

write(): Resource temporarily unavailable [plugins/python/uwsgi_pymodule.c line 711]
write(): Resource temporarily unavailable [plugins/python/uwsgi_pymodule.c line 711]
……

猜测,client在未返回完整结果的情况下关闭浏览器,nginx停止了当前socket,但未通知uwsgi,uwsgi向nginx返回结果,但被通知已经关闭,所以报错

An error occurred in the current transaction. You can’t execute queries until the end of the ‘atomic’ block.

runserver运行django项目的时候并未碰到这个问题,但用uwsgi时就比较频繁了
找到了一个好理解的解释

with transaction.atomic():
            try:
                do_something()
            except:
                pass
            do_something2()

数据库在执行do_something()中的某一写操作时发生了错误。但是业务代码里try except捕获了异常但是没有将异常抛出,而是静默处理。代码顺利执行至do_something2(),在执行do_something2()中的数据库请求时,django向数据库发送rollback请求,并抛出异常。

Fri Sep 28 01:06:02 2018 - uwsgi_response_write_headers_do(): Bad file descriptor [core/writer.c line 248] during GET /ws/fpoint (172…~)
OSError: write error

close websocket 时报错
https://github.com/duanhongyi/dwebsocket/issues/14

猜你喜欢

转载自blog.csdn.net/weixin_33127753/article/details/83896524
今日推荐