【问题标题】:Broken pipe error in Django Nonrel when loading localhost加载 localhost 时 Django Nonrel 中的管道损坏错误
【发布时间】:2011-11-11 02:20:26
【问题描述】:

使用 Google App Engine 2.6.0 和 Python 2.7 运行 Django Nonrel,我在尝试首次加载 localhost 和 localhost/admin 时遇到此异常(但我希望它会发生在任何页面上):

Exception happened during processing of request from ('127.0.0.1', 57011)
    Traceback (most recent call last):
      File "/usr/lib/python2.7/SocketServer.py", line 284, in _handle_request_noblock
        self.process_request(request, client_address)
      File "/usr/lib/python2.7/SocketServer.py", line 310, in process_request
        self.finish_request(request, client_address)
      File "/usr/lib/python2.7/SocketServer.py", line 323, in finish_request
        self.RequestHandlerClass(request, client_address, self)
      File "/usr/local/google_appengine/google/appengine/tools/dev_appserver.py", line 2438, in __init__
        BaseHTTPServer.BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
      File "/usr/lib/python2.7/SocketServer.py", line 641, in __init__
        self.finish()
      File "/usr/lib/python2.7/SocketServer.py", line 694, in finish
        self.wfile.flush()
      File "/usr/lib/python2.7/socket.py", line 303, in flush
        self._sock.sendall(view[write_offset:write_offset+buffer_size])
    error: [Errno 32] Broken pipe

奇怪的是,它只出现在谷歌浏览器上。使用 Firefox 时,它不会打印任何异常(或者至少,经过多次尝试,我无法在 Firefox 中复制此问题)。

有人知道这个问题吗?

谢谢

【问题讨论】:

    标签: python google-app-engine django-nonrel


    【解决方案1】:

    Chrome 和 dev_appserver.py 之间存在竞争条件问题 a few similar reports。通常的故事是 Chrome 打开到服务器的多个并发连接,但首先在第二个连接上发送请求。因为 dev_appserver 是单线程的,所以第一个请求会阻塞,服务器会挂起,直到有人放弃。

    假设用 --disable-preconnect 启动 Chrome 可以防止这种情况。

    【讨论】:

    • 哦,差点错过你的答案。非常感谢。很高兴知道这是一个已知问题。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-11-04
    • 1970-01-01
    • 2016-07-21
    • 2014-04-28
    • 2011-02-12
    • 2015-07-13
    • 1970-01-01
    相关资源
    最近更新 更多