-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use seg duration to time out remote transcoders. #1511
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just couple of small suggestions
server/rpc.go
Outdated
os = segData.Storage[0] | ||
} | ||
|
||
dur := time.Duration(int64(segData.Duration) * int64(time.Millisecond)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dur := time.Duration(int64(segData.Duration) * int64(time.Millisecond)) | |
dur := time.Duration(segData.Duration) * time.Millisecond |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in b7a6479
// Deprecated by segData. Job the segment belongs to. | ||
string job = 2; | ||
|
||
// Deprecated by fullProfiles. Set of presets to transcode into. | ||
bytes profiles = 17; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
recommended way of deprecating fields
bytes profiles = 17; | |
bytes profiles = 17 [deprecated=true]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice - didn't know about this annotation! Actually, kept this line in place since we still "use" it via setting an invalid value to induce failures. Added a comment to the protobuf indicating this in 4d95785
According to the protobuf docs, this is a no-op in all languages except Java, where it emits a warning. My concern is that if golang ever picks this up - golang only has errors, no warnings - this could cause code to stop compiling and the annotation would have to be removed. I'm not entirely sure about the implications of this, so it seems safer to just keep things as-is.
net/lp_rpc.proto
Outdated
bytes profiles = 17; | ||
|
||
// Transcoding profiles to use. Supersedes `profiles` field | ||
// Deprecated by segData. Transcoding configuration to use. | ||
repeated VideoProfile fullProfiles = 33; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
repeated VideoProfile fullProfiles = 33; | |
repeated VideoProfile fullProfiles = 33 [deprecated=true]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made this reserved
in 4d95785
net/lp_rpc.proto
Outdated
// Deprecated fields. May still be populated sometimes for back compat | ||
|
||
// Deprecated by segData. Job the segment belongs to. | ||
string job = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
recommended way of deprecating field that's not used anymore
string job = 2; | |
// string job = 2; | |
reserved 2; | |
reserved "job"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, reserved the number in 4d95785 . Didn't reserve the field name since we don't do JSON, so there should not be a conflict. (Can still add that in if you feel it should be there though.)
Addressed comments via fixup, and also made a clean-up pass through the protobuf file to remove trailing whitespace in 98ab212. Cosmetic changes; nothing functional. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM pending green CI
Enables better reuse. Transcoder now has similar compatibility assurances as B / O without having to re-implement anything.
Makes things simpler overall.
This will simplify the parameterization of the Transcode function.
Cosmetic only; no functional changes.
Rebased, merged |
What does this pull request do? Explain your changes. (required)
As described in #1478 , orchestrator timeouts for a remote T need to be adjusted to handle longer segment durations.
In addition to transmitting the duration from the B to the O in
net.SegData
, the duration also needs to be made available to the orchestrator's remote transcoder manager to make use of it. The remote transcoder manager follows the Transcoder interface, which offers nowhere to put the duration:Since both the orchestrator and broadcaster make use of
core.SegTranscodingMetadata
(CSTMD), which has similar fields asnet.SegData
, we formalize this relationship [1] and extract mappings ( 1, 2 ) to / from each: the latter for propagation over the wire, and the former for propagation throughout the codebase.Having the
Transcoder
interface take aCSTMD
effectively subsumes thejob
andprofiles
parameters, withCSTMD.ManifestID
andCSTMD.Profiles
respectively. From there, there is little reason not to also incorporate thefname
parameter, resulting in the this interface:The O-T protocol is also adjusted to take
net.SegData
. Although not strictly necessary since the standalone transcoder does not currently require the duration [2], this has the side effect of a small reduction in technical debt for standalone T, due to reuse of the mappings betweennet.SegData
andCSTMD
. Any fields that are added to these structs, such as a denominator for the framerate (#1474 (comment)) will be available by default to standalone T. Back-compat logic that is developed within the mappings will also carry over.[1] We could have opted to carry
net.SegData
throughout the codebase rather than making use ofCSTMD
, but the back-compat innet.SegData
requires some translation before its fields can be used within the codebase, eg around profiles. This gives us the ability to evolve each structure as needed. We've already done so with the incorporation of theFname
field to CSTMD which isn't necessary over the wire.[2] The transcoder will need the duration as soon as it's ready to be incorporated into the load balancer.
Specific updates (required)
How did you test each of these updates (required)
Does this pull request close any open issues?
Checklist:
./test.sh
pass