Skip to content

add timeout to super().request(). Ducobox may sometimes hang.#18

Open
wouterteepe wants to merge 1 commit into
Sikerdebaard:mainfrom
wouterteepe:timeout
Open

add timeout to super().request(). Ducobox may sometimes hang.#18
wouterteepe wants to merge 1 commit into
Sikerdebaard:mainfrom
wouterteepe:timeout

Conversation

@wouterteepe
Copy link
Copy Markdown
Contributor

DucoUrlSession extends requests.Session but doesn't set timeouts on HTTP calls. When super().request() is called without a timeout parameter, requests can hang indefinitely.

This is observed in pull request Sikerdebaard/hacs-ducobox-connector#39.

Instead of adding lots of code to that library, let's address it at the source.

The timeout is set at 15 seconds. No strong opinions on what the timeout should be, except that it should ideally be below one minute and allow some lag of the ducobox.

Please note that this issue can also occur without even using hacs-ducobox-connector, but just by using docupy itself. Or, more honestly, it occurs with the ducobox itself, which is sometimes not responsive. (I'll configure it to reboot frequently, but still the library should handle timeouts graceously).

…quest Sikerdebaard#19 of hacs-ducobox-connector in an elegant way, at the source.
@halfa
Copy link
Copy Markdown

halfa commented May 9, 2026

I encounter that quite often as well, however I never had to reboot my ducobox, only the client seems to stall

@wouterteepe
Copy link
Copy Markdown
Contributor Author

I encounter that quite often as well, however I never had to reboot my ducobox, only the client seems to stall

Unfortunately, I have experienced worse (or: differently). While testing with the client from the CLI, response times sometimes increase to absurd lengths. At some moment I thought I went crazy and tried to connect using the Duco installation app, and even that one failed to get a response out of the Ducobox and actively suggested to power cycle the box.

Long story short for: though sometimes it may be the client, certainly there are situations in which the box itself is to "blame". This fix helps dealing with that (particular but unfortunately for me common) situation, by detecting and reporting it properly.

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.

2 participants