Skip to content

libhsscomm: bound the asynchronous callbacks with a timeout - #208

Open
hobbyquaker wants to merge 1 commit into
OpenCCU:mainfrom
hobbyquaker:fix/171-async-timeout
Open

hobbyquaker wants to merge 1 commit into
OpenCCU:mainfrom
hobbyquaker:fix/171-async-timeout

Conversation

@hobbyquaker

Copy link
Copy Markdown

AsyncXmlRpcSender sends newDevices, deleteDevices, replaceDevice, updateDevice and the service events from a detached thread per call, with an XmlRpcClient that has no timeout. A receiver that accepts the call and never answers keeps that thread and its socket alive for as long as it keeps the connection open, and every further init or device change adds another one - rfd and hs485d grow by a thread and a socket each time until they run out of either.

Give the client a 30 s timeout: a timed-out call takes the existing transport error path, the thread logs it and ends. The result of these calls is never used beyond the log line, so a receiver that is merely slow loses nothing but gets an error line in the log; 30 s keeps that away from any healthy receiver.

Fixes #171

AsyncXmlRpcSender sends newDevices, deleteDevices, replaceDevice,
updateDevice and the service events from a detached thread per call,
with an XmlRpcClient that has no timeout. A receiver that accepts the
call and never answers keeps that thread and its socket alive for as
long as it keeps the connection open, and every further init or device
change adds another one - rfd and hs485d grow by a thread and a socket
each time until they run out of either.

Give the client a 30 s timeout: a timed-out call takes the existing
transport error path, the thread logs it and ends. The result of these
calls is never used beyond the log line, so a receiver that is merely
slow loses nothing but gets an error line in the log; 30 s keeps that
away from any healthy receiver.

Fixes OpenCCU#171
@coderabbitai

coderabbitai Bot commented Oct 16, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5077513d-ad2f-43b3-bbf8-462b4f47b0e7
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

libhsscomm: Every unanswered newDevices/deleteDevices/replaceDevice leaves a thread and a socket behind for good

1 participant