django-socketio icon indicating copy to clipboard operation
django-socketio copied to clipboard

Machine gun reloading

Open thomasw opened this issue 14 years ago • 2 comments

If you rapidly refresh with any browser, you'll eventually see something like this:

Traceback (most recent call last):
  File "/srv/pyenv/costory/lib/python2.6/site-packages/gevent/greenlet.py", line 390, in run
    result = self._run(*self.args, **self.kwargs)
  File "/srv/pyenv/costory/lib/python2.6/site-packages/socketio/transports.py", line 211, in send_into_ws
    websocket.send(self.encode(message))
  File "/srv/pyenv/costory/lib/python2.6/site-packages/geventwebsocket/websocket.py", line 25, in send
    self.socket.sendall("\x00" + message + "\xFF")
  File "/srv/pyenv/costory/lib/python2.6/site-packages/gevent/socket.py", line 504, in sendall
    data_sent += self.send(_get_memory(data, data_sent), flags)
  File "/srv/pyenv/costory/lib/python2.6/site-packages/gevent/socket.py", line 478, in send
    return sock.send(data, flags)
error: [Errno 32] Broken pipe
<Greenlet at 0x107d3e518: send_into_ws> failed with error

Traceback (most recent call last):
  File "/srv/pyenv/costory/lib/python2.6/site-packages/gevent/greenlet.py", line 390, in run
    result = self._run(*self.args, **self.kwargs)
  File "/srv/pyenv/costory/lib/python2.6/site-packages/socketio/transports.py", line 215, in read_from_ws
    message = websocket.wait()
  File "/srv/pyenv/costory/lib/python2.6/site-packages/geventwebsocket/websocket.py", line 71, in wait
    frame_str = self.rfile.read(1)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/socket.py", line 377, in read
    data = self._sock.recv(left)
  File "/srv/pyenv/costory/lib/python2.6/site-packages/gevent/socket.py", line 418, in recv
    return sock.recv(*args)
error: [Errno 54] Connection reset by peer
<Greenlet at 0x107d3e490: read_from_ws> failed with error

This appears to prevent the on_finish event from executing.

thomasw avatar Sep 05 '11 09:09 thomasw

From the look of the traceback there isn't a point where this could be captured in django-socketio

If there is then I'd definitely want to implement handling for it.

Might be worth raising it with the geventwebsocket or gevent projects.

stephenmcd avatar Sep 06 '11 02:09 stephenmcd

I'll see if I can churn out a simpler example or try to duplicate the issue with their example code and post an issue for them. Thanks for taking a look!

thomasw avatar Sep 07 '11 22:09 thomasw