Skip to content

Detect broken connections / make timeout configurable#42

Merged
JohnDoee merged 2 commits into
JohnDoee:developfrom
dsander:connection-detection
Feb 17, 2024
Merged

Detect broken connections / make timeout configurable#42
JohnDoee merged 2 commits into
JohnDoee:developfrom
dsander:connection-detection

Conversation

@dsander
Copy link
Copy Markdown
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
Copy Markdown

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.

3 participants