Add ability to customize the video redundancy timeout - #7778
Open
m-altaifi wants to merge 1 commit into
Open
Conversation
Mirroring a big video could not take longer than 3 hours, and the HLS download budget was taken from `import.videos.timeout`, so raising it to let a mirror finish also changed video import behaviour. Add `redundancy.videos.timeout`, feeding both the `video-redundancy` job TTL and the HLS download budget, the same way `import.videos.timeout` already feeds `video-import`. Closes Chocobozzz#5519
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.
Summary
Adds
redundancy.videos.timeoutso a mirror of a large video can be given more time, as you retitled #5519 to ask for.Why two things had to change
Mirroring was capped twice, and neither cap was configurable:
JOB_TTL['video-redundancy']was hardcoded to1000 * 3600 * 3. This is the cap the reporter hit: their job ran 12:11:46 to 15:11:46, exactly 3 hours, and failed with a bareError: Timeout.createStreamingPlaylistRedundancypassedVIDEO_IMPORT_TIMEOUTtodownloadPlaylistSegments, which applies it as a single budget for the whole download rather than per segment. That value is0.9 * import.videos.timeout, so the HLS mirror was governed by the video import setting: 1.8h at defaults, i.e. tighter than the job TTL.So raising only one of them would not help, and an admin raising
import.videos.timeoutto make mirroring work would silently change video import behaviour too.Both now derive from the new option, following the existing
import.videos.timeout->JOB_TTL['video-import']->VIDEO_IMPORT_TIMEOUTpattern:Effect at default config
video-redundancyjob TTLimport.videos.timeoutredundancy.videos.timeoutVIDEO_IMPORT_TIMEOUTThe job TTL default is unchanged. The download budget now sits just under the job TTL instead of being controlled by an unrelated setting, so the download fails with
HLS download timeout.rather than the job being cancelled first, and both scale together when the option is raised.I picked
'3 hours'to keep the job TTL exactly as it is today. That does loosen the effective download budget from 1.8h to 2.7h.'2 hours'would track today's real-world behaviour more closely but would shorten the job cap, so I went with the one that matches the intent of the issue. Happy to change it.Verification
pnpm run validate-config-schema— OK forconfig/default.yamland the Docker production configconfig/config-schema.jsonregenerated withpnpm run generate-config-schema, not hand-editedtsc -b server/tsconfig.json— cleanoxlinton the touched files — cleanCONFIGintoconstants.ts(constants.tsreadsCONFIGat module load, as it already does forvideo-import), producing the table aboveredundancy.videos.timeoutregistered inchecker-before-init.tsalongsideredundancy.videos.check_intervalI did not add an automated test: the behaviour is a multi-hour timeout, so a test would either not exercise it or need the constants stubbed. Happy to add one if you have a preferred shape.
Targeted
developsince it adds a configuration option; happy to retarget torelease/v8.3.x.Closes #5519