Skip to content

1.30.1: ADB install broke off after 10 s on slow TVs - #52

Merged
mhoogenbosch merged 2 commits into
mainfrom
fix/adb-timeouts
Oct 25, 2026
Merged

mhoogenbosch merged 2 commits into
mainfrom
fix/adb-timeouts

Conversation

@mhoogenbosch

Copy link
Copy Markdown
Owner

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 -r prints 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 every bulk_read.

Fix

  • shell() and push() pass read_timeout_s=SHELL_TIMEOUT too.
  • _EofSafeTransport (a TcpTransportAsync passed to the public AdbDeviceAsync constructor) 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

  • 135 tests; test_shell_waits_for_silent_command now checks the effective timeout through adb-shell's own _AdbTransactionInfo, and test_closed_socket_fails_fast the EOF path.
  • Real TCL (Atelier, Android 11) from the Proxmox harness with HA's Android TV key: push 0.8 s, pm install 12.7 s → Success, app-ops re-granted, accessibility kept, the service came back by itself.

🤖 Generated with Claude Code

mhoogenbosch and others added 2 commits October 25, 2026 22:26
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>
@mhoogenbosch
mhoogenbosch merged commit ac4e3a9 into main Oct 25, 2026
2 checks passed
@mhoogenbosch
mhoogenbosch deleted the fix/adb-timeouts branch October 25, 2026 21:32
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.

1 participant