"error: [Errno 32] Broken pipe"浅析

问题:

Exception happened during processing of request from ('127.0.0.1', 54154)
Traceback (most recent call last):
  File "/root/.pyenv/versions/2.7.13/lib/python2.7/SocketServer.py", line 290, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/root/.pyenv/versions/2.7.13/lib/python2.7/SocketServer.py", line 318, in process_request
    self.finish_request(request, client_address)
  File "/root/.pyenv/versions/2.7.13/lib/python2.7/SocketServer.py", line 331, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/root/.pyenv/versions/2.7.13/lib/python2.7/SocketServer.py", line 654, in __init__
    self.finish()
  File "/root/.pyenv/versions/2.7.13/lib/python2.7/SocketServer.py", line 713, in finish
    self.wfile.close()
  File "/root/.pyenv/versions/2.7.13/lib/python2.7/socket.py", line 283, in close
    self.flush()
  File "/root/.pyenv/versions/2.7.13/lib/python2.7/socket.py", line 307, in flush
    self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
----------------------------------------

一个client连接一个server。 当client 端的请求发送到server端, server端要回写数据给client的时候,client端终止,server 端就出现这样的情况。

上面的情况是启动了一个 flask web server, 用压力测试工具 siege 进行测试。中途中断 siege。

更多代码见:
https://github.com/jiaxiaolei/my_flask_project

你可能感兴趣的:("error: [Errno 32] Broken pipe"浅析)