Skip to content

fix(Extractor): drop dead pooled connections instead of timing out - #8847

Closed
zamelek wants to merge 1 commit into
libre-tube:masterfrom
zamelek:pr/dead-pooled-connections
Closed

zamelek wants to merge 1 commit into
libre-tube:masterfrom
zamelek:pr/dead-pooled-connections

Conversation

@zamelek

@zamelek zamelek commented Oct 6, 2026

Copy link
Copy Markdown

Problem

Fetching the next video sometimes never finishes (endless loading wheel). The reason: the OkHttpClient of the extractor keeps an HTTP/2 connection in its pool that the router silently dropped while the previous video was playing. The request times out (10 s) on it, and all retries reuse the same dead connection. It happened reliably after a video ended on Wi-Fi.

Fix

In NewPipeDownloaderImpl: idle connections are closed after 20 s, HTTP/2 connections are pinged every 15 s, and after an IOException the whole pool is dropped and the request is repeated once on a new connection.

Tested

The log line before the fix: failed to fetch streams ... SocketTimeoutException three times in a row; with the fix the next video loads.


Disclosure: I know that the contributing guide does not permit AI generated contributions. The code of this PR and this description were written with the help of an AI assistant (Claude Code, see the Co-Authored-By trailer of the commit). I did not hide this. I use the app daily, I reviewed the behavior and tested the change on my device (Pixel 8a, GrapheneOS / Android 16, built from current master). Please feel free to close the PR if it is not acceptable, or to take it only as a bug report with a possible fix.

An HTTP/2 connection that the router silently dropped while a video played stayed in the pool of the
extractor's OkHttpClient, and every retry of the next request timed out on it (endless loading). Idle
connections are now closed after 20 s, HTTP/2 connections are pinged, and after an IOException the
pool is dropped and the request is repeated once on a new connection.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@FineFindus FineFindus added the invalid Issue template not used properly label Oct 6, 2026
@FineFindus FineFindus closed this Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

invalid Issue template not used properly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants