Repository navigation
fix: time out local connection attempts to unreachable devices - #1077
Merged
allenporter merged 1 commit intoNov 23, 2026
Merged
Conversation
Connecting the local channel had no timeout, so when the device's LAN address was unreachable (packets dropped rather than refused) the TCP connect blocked until the operating system gave up. Device startup waits on this first attempt before subscribing over MQTT, so the device stayed disconnected and traits were not discovered even though MQTT worked. The connect now uses the existing local timeout, so startup falls back to MQTT and the background task keeps retrying local.
allenporter
approved these changes
Nov 23, 2026
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.
Problem
When the robot’s LAN address silently drops packets, the first local TCP connection attempt can wait for the operating system’s timeout. V1 startup is waiting for that attempt, so it cannot fall back to MQTT in the meantime.
Changes
Use the existing local-channel timeout for the TCP connect. The timeout goes through the existing
RoborockConnectionExceptionpath, so V1 startup can fall back to MQTT and the background task can keep retrying the local connection. This is distinct from #1027, which handles a timeout after an RPC has been sent.Testing
connect()raisesRoborockConnectionExceptionand leaves the channel disconnected.321c6d5. The default suite excludes the 11 real-broker tests.