我正在django的开发服务器上运行django。它以前工作得很好,但从昨天开始,我在运行服务器的linux命令行上不断收到这个错误。
Exception happened during processing of request from ('57.xx.xx.123', 63721)
Traceback (most recent call last):
File "/opt/python27/lib/python2.7/SocketServer.py", line 284, in _handle_reque st_noblock
self.process_request(request, client_address)
File "/opt/python27/lib/python2.7/SocketServer.py", line 310, in process_reque st
self.finish_request(request, client_address)
File "/opt/python27/lib/python2.7/SocketServer.py", line 323, in finish_reques t
self.RequestHandlerClass(request, client_address, self)
File "/opt/python27/lib/python2.7/site-packages/django/core/servers/basehttp.p y", line 570, in __init__
BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
File "/opt/python27/lib/python2.7/SocketServer.py", line 641, in __init__
self.finish()
File "/opt/python27/lib/python2.7/SocketServer.py", line 694, in finish
self.wfile.flush()
File "/opt/python27/lib/python2.7/socket.py", line 301, in flush
self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
有人能告诉我为什么现在开始发生吗
这种情况只发生在的10次中的1次
"Broken pipe"表示当目标关闭时,文件描述符(在本例中为套接字(上仍有传出数据。
在这种情况下,最有可能的原因是浏览器在Django开发服务器发送整个响应之前关闭了连接。
偶尔,在发生异常后,或者在进行跨浏览器/平台测试时,从Windows连接到Linux时,我会看到管道破裂。我不确定是什么原因导致了这些错误,但我只知道重新启动Django的开发服务器就可以修复它