[backport][HLSTree] Fix manifest update thread spinning after a failed live update - #2108
Merged
Merged
Conversation
When a live HLS manifest update failed, CHLSTree::OnUpdateSegments halved m_updateInterval as a temporary backoff. On the second consecutive failure the value being halved was the NO_VALUE sentinel that TreeUpdateThread sets before each update, because a failed download never reaches the parse that would replace it. NO_VALUE / 2 passes the worker loop guard but overflows the ms-to-ns conversion in wait_for, so the wait returned immediately and the thread issued manifest requests as fast as the network allowed (measured at 350-450 per second against a 404 origin). The sentinel reached the halving because m_resetInterval was set by ResetInterval() and never cleared, so from the first failure on every iteration wiped the interval before the parse. - TreeUpdateThread clears m_resetInterval after applying it, so the reset happens once on the next update as documented - TreeUpdateThread records m_lastValidUpdateInterval before clearing, skipping values a parser lowered as a backoff - CHLSTree::OnUpdateSegments halves that recorded interval instead of m_updateInterval, with a lower bound so it cannot reach zero and stop the update thread DASHTree and SmoothTree assign m_updateInterval directly and are not affected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
bp #2098
Motivation and context
How has this been tested?
Screenshots (if appropriate):
Types of change
Checklist: