Repository navigation
libhsscomm: bound the asynchronous callbacks with a timeout - #208
Open
hobbyquaker wants to merge 1 commit into
Open
hobbyquaker wants to merge 1 commit into
hobbyquaker wants to merge 1 commit into
Conversation
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
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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