pydle: Failure to reconnect
I’m using client.run in the asyncio branch, and after a short period of being connected, I’m encountering:
Encountered error on socket.
TimeoutError: Ping timeout: no data received from server in 180 seconds.
Unexpected disconnect. Attempting to reconnect.
after which the memory for the process jumps from ~15 MB to ~2 GB. This seems to be because on_data is triggered constantly with empty bytestrings. It’s possible this is a result of handle_forever continuing after the connection is disconnected. I’m not sure what’s causing the initial ping timeout though. I’m using a program that was running properly with the master branch, and just converted it by adding async’s and await’s to overrides and calls of functions that were converted into coroutines and by using client.run instead of client.connect and client.handle_forever
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 35 (19 by maintainers)
Commits related to this issue
- Don't handle data when disconnected. Should fix at least part of #51. — committed to shizmob/pydle by shizmob 8 years ago
- #51 Added on_pong and on_pong_raw callbacks - needed to avoid needless unhandled event warnings — committed to theunkn0wn1/pydle by theunkn0wn1 5 years ago
- #51 Added ping check @dazuling suggested — committed to theunkn0wn1/pydle by deleted user 5 years ago
- #51 Added ping check @dazuling suggested — committed to theunkn0wn1/pydle by deleted user 5 years ago
- [Twitch] Replace pydle with irc https://github.com/Shizmob/pydle/issues/51#issuecomment-518196718 https://github.com/Shizmob/pydle/issues/162 Add jaraco.collections, jaraco.functools, jaraco.logging... — committed to Harmon758/Harmonbot by Harmon758 a year ago
Something to note is that the server may not necessarily send a PING within every
PING_TIMEOUTseconds if the client has been active. Perhaps an alternative solution is to PING the server before going through with the client disconnect to verify that the server has stopped communicating with the client.e.g. change https://github.com/Shizmob/pydle/blob/master/pydle/client.py#L170 to
there is,
Client.on_disconnect(expected:bool)