Skip to content

[bug] A second server restart in one session leaves the player frozen #586

Open

Description

@Quick104

What happened

Direct play survives one server restart but not a second one in the same session. The player ends up on a frozen frame with no error message and does not recover, even though the server is back within seconds.

In testing:

  1. First restart: the progressive loader hit a stream reset, retried once, and kept playing.
  2. Second restart, 110 s later: MediaLoadRetry gave up on the first error (retry exhausted ... attempt=2), although the server answered again within 3 s.
  3. The player played out its buffer for about 110 s, then failed with ERROR_CODE_IO_NETWORK_CONNECTION_FAILED and logged "Transient network error; retrying same route (1/1)".
  4. It then stayed idle on a frozen frame with no message for 65+ s, until the test ended. The server was healthy the whole time.

From the source, two things combine:

  • firstErrorAtByLoadTask in MediaLoadRetryPolicy.kt is set once per load task and cleared only when the task ends. A direct-play progressive load spans the whole file, so at the second outage the 90 s window measured from the first one has already expired.
  • The same-route reopen runs once per playback attempt (recordTransportReopen in PlaybackSessionManager.kt), and that one reopen did not bring playback back.

Smaller issue seen in the same runs: when an outage outlasts the buffer, the app shows only a spinner and never says the server is unreachable. It does wait and resume on its own once the server is back. The stall fallback logs "Falling back to transcoded stream" although it reopens the same route.

Steps to reproduce

  1. Play a movie at original quality (direct play).
  2. About 10 s in, recreate the server's API and node containers (docker compose up -d --force-recreate).
  3. About 110 s later, do it again.
  4. Wait for the buffer to run out.

Expected behavior

Each outage gets its own retry window. When the buffer runs out while the server is unreachable, the player says so, keeps retrying until the server answers, and resumes at the same position.

Device

Phone (emulator)

Device model and OS version

Android emulator, Pixel 6 profile, API 36. Android TV shares the player logic (TvPlayerViewModel) but was not run.

App version and build

Debug build from main at b5bf859.

Installed from

Built from source.

Silo server version

Dev deployment built 2026-10-14 (API plus two proxy and two transcode nodes, behind a reverse proxy).

Playback details

H.264/AAC 720p MP4, original_http.

Relevant logs

I/MediaLoadRetry: progressive direct-play retry error=StreamResetException: stream was reset: INTERNAL_ERROR bytes_loaded=107764498 resume_offset=595460160 attempt=1 retry_delay_ms=1000
W/MediaLoadRetry: progressive direct-play retry exhausted error=StreamResetException: stream was reset: INTERNAL_ERROR bytes_loaded=49139560 resume_offset=644599720 attempt=2
E/Media3Analytics: Player error ERROR_CODE_IO_NETWORK_CONNECTION_FAILED: Source error
I/PlayerViewModel: Transient network error; retrying same route (1/1)

Related: #450, #3.

Activity

  1. added
    bug
    on Oct 14, 2026
  2. added
    impact: playback
    priority: P1
    on Oct 14, 2026
  3. self-assigned this
    on Oct 14, 2026
  4. Quick104 commented on Oct 14, 2026

    @Quick104
    ContributorAuthor

    🤖 AI agent claim. Claude Code in T3 Code (claude-opus-5-5) is working on a fix for this issue on behalf of @Quick104, who is assigned.

    A pull request will link here when the fix is ready. If the work stops without a fix, the assignment and this comment are removed.

    Planning to work on this, or have context to add? Reply here and mention @Quick104.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugimpact: playbackpriority: P1

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions