Repository navigation
1.30.1: ADB install broke off after 10 s on slow TVs - #52
Merged
Merged
Conversation
adb-shell caps the transport timeout at the read timeout (min(transport, read) in _AdbTransactionInfo), so every wait was 10 s. pm install takes 12.7 s on a TCL: HA reported a dropped connection while the TV finished on its own, and the app-ops were not re-granted. Both timeouts are now SHELL_TIMEOUT; an EOF-safe transport reports a closed socket at once so the long read timeout cannot spin the event loop. Verified on the TCL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Bug
On the first real TCL (Android 11) the ADB install failed with "the ADB connection dropped: Reading from …:5555 timed out (10.0 seconds)", although the TV finished the install.
Cause
adb-shell 0.4.4
_AdbTransactionInfo:transport_timeout_s = min(transport_timeout_s, read_timeout_s). 1.29/1.30 passed a 120 s transport timeout but left the read timeout at its 10 s default → every socket wait was 10 s.pm install -rprints nothing until done: 12.7 s on the TCL (≈5 s on a Fire TV, which is why the Fire TV test passed). Traced by logging the timeout of everybulk_read.Fix
shell()andpush()passread_timeout_s=SHELL_TIMEOUTtoo._EofSafeTransport(aTcpTransportAsyncpassed to the publicAdbDeviceAsyncconstructor) raises on an empty read, so a TV closing the socket fails at once instead of adb-shell spinning on EOF until the (now long) read timeout.Tested
test_shell_waits_for_silent_commandnow checks the effective timeout through adb-shell's own_AdbTransactionInfo, andtest_closed_socket_fails_fastthe EOF path.pm install12.7 s → Success, app-ops re-granted, accessibility kept, the service came back by itself.🤖 Generated with Claude Code