Skip to content

SegmentDownloader enters an infinite loop. #2931

@vinni-exo13579111

Description

@vinni-exo13579111

Version

Media3 main branch

More version details

No response

Devices that reproduce the issue

pixel 9

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

No

Reproduction steps

In the getSegmentIndex method DashDownloader, a RunnableFutureTask is created and passed into SegmentDownloader’s
protected final <T> T execute(RunnableFutureTask<T, ?> runnable, boolean removing)
Inside the execute method there is a while(true) loop.
If the task throws an exception once (e.g., PriorityTooLowException), the loop becomes infinite even after RunnableFutureTask later completes successfully, because runnable.get() will always return the previously stored exception instead of the new result.

RunnableFutureTask.getResult method:

  private R getResult() throws ExecutionException {
    if (canceled) {
      throw new CancellationException();
    } else if (exception != null) {
      throw new ExecutionException(exception);
    }
    return result;
  }

The exception in RunnableFutureTask is never cleared.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions