Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash on reconnect #68

Closed
benapetr opened this issue Feb 19, 2015 · 2 comments
Closed

crash on reconnect #68

benapetr opened this issue Feb 19, 2015 · 2 comments

Comments

@benapetr
Copy link

Source code: https://github.com/huggle/XMLRCS/blob/master/src/ws2r/ws2r.py#L56

No handlers could be found for logger "socketIO_client"
Connecting
Reconnecting
Traceback (most recent call last):
  File "./ws2r.py", line 65, in <module>
    socketIO.wait()
  File "/home/petanb/Public/XMLRCS/src/ws2r/socketIO-client/socketIO_client/__init__.py", line 251, in wait
    self._process_events(timeout)
  File "/home/petanb/Public/XMLRCS/src/ws2r/socketIO-client/socketIO_client/__init__.py", line 268, in _process_events
    for packet in self._transport.recv_packet(timeout):
  File "/home/petanb/Public/XMLRCS/src/ws2r/socketIO-client/socketIO_client/__init__.py", line 332, in _transport
    socketIO_session, self._transport_name)
  File "/home/petanb/Public/XMLRCS/src/ws2r/socketIO-client/socketIO_client/__init__.py", line 380, in _get_transport
    }[transport_name](session, self.is_secure, self._base_url, **self._kw)
  File "/home/petanb/Public/XMLRCS/src/ws2r/socketIO-client/socketIO_client/transports.py", line 146, in __init__
    self._connection = websocket.create_connection(url, header=headers)
  File "/usr/local/lib/python2.7/dist-packages/websocket/_core.py", line 266, in create_connection
    websock.connect(url, **options)
  File "/usr/local/lib/python2.7/dist-packages/websocket/_core.py", line 524, in connect
    self._handshake(hostname, port, resource, **options)
  File "/usr/local/lib/python2.7/dist-packages/websocket/_core.py", line 596, in _handshake
    resp_headers = self._get_resp_headers()
  File "/usr/local/lib/python2.7/dist-packages/websocket/_core.py", line 549, in _get_resp_headers
    raise WebSocketException("Handshake status %d" % status)
websocket._exceptions.WebSocketException: Handshake status 502

I am calling self.emit on reconnect event but it causes the program to crash. Why? How do I implement proper reconnect to source

@benapetr
Copy link
Author

Note there were several hours between connect and reconnect, it's not clear in these logs

@invisibleroads
Copy link
Owner

Are you running the client against a load-balanced server?
https://phabricator.wikimedia.org/T68989

You can activate logging with the following commands.

import logging
logging.basicConfig(level=logging.DEBUG)

Please feel free to reopen this issue if the above fix does not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants