-
Notifications
You must be signed in to change notification settings - Fork 194
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
Lost connection in longPoll #9
Comments
Actually, This is not a new issue because some people told about this but I couldn't find the answer for this issue yet.. |
b5397aa, problem solved. |
I've still found issue after upgraded: Traceback (most recent call last): |
I think this is not the problem of expiration of authToken. I guess |
There're other few error, I'll try to collect here and make exceptions for retrying. But there're sometimes bots just freeze without disconnect and not responding, that is harder to fix and I think there should be some NOOP or PING to probe if connection is alive too. |
I attempted to reconnect when socket error but still not working, any advise?
When I tried to call self.login(), self.read() it's show valid authToken but not able to continue LoginResult(authToken='XXX, verifier=None, type=1, pinCode=None, certificate=None) |
I think you'd better use
when the exception is occurred. It is a method that refresh authToken without PinCode authentication. |
When the connection freezes, I've tried to check with netstats found that the connection is still alive, but no data receiving
What method do you suggest for periodically check if connection is alive? Edited: I tried to create work around for freezing bots by getProfile every minute.
Edited 2: self.login() + self.ready() won't work wells when socket error, it will cause more socket error or another error. I decided to quit the program then rerun it again when socket error using shell
Also getProfile() every minute and updateAuthToken() every almost two hours seem does the job well, I can run bots continuously more than 24 hours now without getting any socket error. Edited 3: It still freeze from time to times so I'm using threading to check if it's still response.
|
#25 seem to be also fixed this. |
This error sometimes occur every 10 minutes, but sometime connection last many hours.
Traceback (most recent call last):
File "echobot.py", line 30, in
for op in client.longPoll():
File "/usr/local/lib/python2.7/dist-packages/line-0.1.8-py2.7.egg/line/client.py", line 379, in longPoll
operations = self._fetchOperations(self.revision, count)
File "/usr/local/lib/python2.7/dist-packages/line-0.1.8-py2.7.egg/line/api.py", line 255, in _fetchOperations
return self._client.fetchOperations(revision, count)
File "/usr/local/lib/python2.7/dist-packages/curve-0.1.0-py2.7.egg/curve/CurveThrift.py", line 482, in fetchOperations
self.send_fetchOperations(localRev, count)
File "/usr/local/lib/python2.7/dist-packages/curve-0.1.0-py2.7.egg/curve/CurveThrift.py", line 492, in send_fetchOperations
self._oprot.trans.flush()
File "/usr/local/lib/python2.7/dist-packages/thrift-0.9.1-py2.7.egg/thrift/transport/THttpClient.py", line 106, in _f
result = f(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/thrift-0.9.1-py2.7.egg/thrift/transport/THttpClient.py", line 139, in flush
self.__http.endheaders()
File "/usr/lib/python2.7/httplib.py", line 969, in endheaders
self._send_output(message_body)
File "/usr/lib/python2.7/httplib.py", line 829, in _send_output
self.send(msg)
File "/usr/lib/python2.7/httplib.py", line 791, in send
self.connect()
File "/usr/lib/python2.7/httplib.py", line 772, in connect
self.timeout, self.source_address)
File "/usr/lib/python2.7/socket.py", line 553, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
socket.gaierror: [Errno -2] Name or service not known
The text was updated successfully, but these errors were encountered: