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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect broken connections / make timeout configurable #42

Merged
merged 2 commits into from
Feb 17, 2024

Conversation

dsander
Copy link
Contributor

@dsander dsander commented Dec 29, 2020

Hi! 馃憢

I was trying to use the deluge integration of Home Assistant which uses this egg. I noticed that the deluge device in Home Assistant stayed unreachable after the deluge server was restarted. This happened because a broken connection was not detected and thus never reset.


Detect closed connections in _receive_response

When the connection to the deluge server was lost (the server was
restarted or shut down), _receive_response was stuck in a infinite
loop before. Since recv never returns any data the function never broke
out of the while loop. Raising a ConnectionLostException ensures the
retry logic can work as expected.


Make the socket timeout configurable

When the connection to the deluge server was lost (the server was
restarted or shut down), `_receive_response` was stuck in a infinite
loop before. Since `recv` never returns any data the function never broke
out of the while loop. Raising a `ConnectionLostException` ensures the
retry logic can work as expected.
@kslr
Copy link

kslr commented Mar 1, 2021

looks great.

tobbez added a commit to tobbez/deluge-client that referenced this pull request Oct 20, 2023
@JohnDoee JohnDoee merged commit 052275e into JohnDoee:develop Feb 17, 2024
dsander added a commit to dsander/core that referenced this pull request Feb 18, 2024
This mainly addresses the client hanging and not reconnecting whenever
the deluge server is restarted. See JohnDoee/deluge-client#42

JohnDoee/deluge-client@1.10.0...1.10.2
MartinHjelmare pushed a commit to home-assistant/core that referenced this pull request Feb 19, 2024
This mainly addresses the client hanging and not reconnecting whenever
the deluge server is restarted. See JohnDoee/deluge-client#42

JohnDoee/deluge-client@1.10.0...1.10.2
frenck pushed a commit to home-assistant/core that referenced this pull request Feb 22, 2024
This mainly addresses the client hanging and not reconnecting whenever
the deluge server is restarted. See JohnDoee/deluge-client#42

JohnDoee/deluge-client@1.10.0...1.10.2
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.

None yet

3 participants