Skip to content
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

Add callback heartbeats for in-flight transcodes #65

Merged
merged 2 commits into from Oct 17, 2022
Merged

Conversation

thomshutt
Copy link
Contributor

@thomshutt thomshutt commented Oct 17, 2022

This doesn't do the checking of transcode progress with Mist, but does provide the framework where we'd slot that in.

For now, if an item is in the "Transcode" cache, we update Studio every 15 seconds. I'd guess this is also going to expose some bugs where we're not removing things from the cache when we should be.

@codecov
Copy link

codecov bot commented Oct 17, 2022

Codecov Report

Merging #65 (7f4d520) into main (05d2a0e) will increase coverage by 0.86170%.
The diff coverage is 85.00000%.

Impacted file tree graph

@@                 Coverage Diff                 @@
##                main         #65         +/-   ##
===================================================
+ Coverage   35.58119%   36.44289%   +0.86169%     
===================================================
  Files             17          17                 
  Lines           1127        1147         +20     
===================================================
+ Hits             401         418         +17     
- Misses           680         682          +2     
- Partials          46          47          +1     
Impacted Files Coverage Δ
cache/transcoding.go 49.25373% <85.00000%> (+15.21117%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 05d2a0e...7f4d520. Read the comment docs.

Impacted Files Coverage Δ
cache/transcoding.go 49.25373% <85.00000%> (+15.21117%) ⬆️

Copy link
Contributor

@AlexKordic AlexKordic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done!

default:
}

jobs := t.GetAll()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: seems possible to have a race between this thread and transcode thread. We should expect on studio side to receive a heartbeat callback after transcode-complete callback. We should notify studio team about this quirk.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! I think Studio already has logic where they'll throw away messages if "Completion %" is less than one they've already received, which is quite a nice way of getting some thread safety around this stuff without them implementing a full on state machine

@thomshutt thomshutt merged commit 36df739 into main Oct 17, 2022
@thomshutt thomshutt deleted the heartbeats branch October 17, 2022 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants