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

Updated websocket library and fixed bugs due to reconnects #98

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dcmeglio
Copy link

This fixes #97 . I removed unnecessary threads that were being created around run_forever. run_forever already creates a thread so this is a waste of resources. I also discovered the constant reconnect issue was because the connection checker was continuing to run while in reconnect mode. This was because of a bad state check. We now kill the connection checker no matter what when stop() is called. I also updated the websocket-client library because it was very out of date. This resolved all my issues and seemed to introduce no additional problems in my testing.

This library seems like it might be dead but I hope you'll consider this PR. I'd hate to have to maintain a fork just to fix this bug :(

@fijackokresimir
Copy link

i tried running your version and it seems that reconnection is functioning better, but i still have ocasionally errors such as websocketbadstatusexception 404 during handshake. i am running asp.net core 6 app and i tried to turn it off / on and it sometimes work but sometimes i get this 404 on handshake which is weird.
i tried skipNegotiation=true, but it didn't help

have you experienced these errors? am i missing something? i thought that this reconnect should work out of the box.
i noticed that 'websocket_transport.py' ln167 has '#raise HubError(error)' which maybe should be uncommented to at least have on_error event triggered
?

@thch-cubido
Copy link

start will then cause the calling thread to block. This is why it has been wrapped, I guess.

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

Successfully merging this pull request may close these issues.

Reconnect logic spamming logs and creating threads until resource exhaustion occurs
3 participants