Skip to content

Conversation

@bastimeyer
Copy link
Member

@bastimeyer bastimeyer commented Mar 10, 2023

The SegmentedStreamWriter's _wait event needs to be set before awaiting the shutdown of the thread-pool executor, otherwise the threads of the executor won't ever receive this signal. For example, queued segment downloads can't be cancelled because the event never gets set before awaiting the shutdown of the executor, so wait() calls in the executor's threads time out regularly and return True.


Fixes queued DASH segments being downloaded after closing the stream.

The `SegmentedStreamWriter`'s `_wait` event needs to be set before
awaiting the shutdown of the thread-pool executor, otherwise the threads
of the executor won't ever receive this signal. For example, queued
segment downloads can't be cancelled because the event never gets set
before awaiting the shutdown of the executor, so `wait()` calls in the
executor's threads time out regularly and return `True`.
@gravyboat gravyboat merged commit f234c69 into streamlink:master Mar 11, 2023
@bastimeyer bastimeyer deleted the stream/segmented/fix-wait-in-writer-thread-pool branch March 11, 2023 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants