-
Notifications
You must be signed in to change notification settings - Fork 2
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 errgroup to write segments to disk in background #998
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #998 +/- ##
===================================================
- Coverage 52.44519% 52.43504% -0.01015%
===================================================
Files 70 70
Lines 7709 7659 -50
===================================================
- Hits 4043 4016 -27
+ Misses 3344 3322 -22
+ Partials 322 321 -1
Continue to review full report in Codecov by Sentry.
|
Why replace channel logic when it's been working alright? Also not saving that many lines of code IMO |
I just find it much easier to follow and really prefer to avoid channels wherever possible. I don't think the current implementation surfaces errors whereas with errgroup this is just built in. catalyst-api/transcode/transcode.go Lines 211 to 214 in 513a513
|
I'm the opposite - channels just kind of fit nicely into the produce-consumer model and the framework sort of made sense to me and I was able to reason around it. The errors are captured in various stages in the channel implementation and surfaced up (e.g. fail to get segment, or fail to write incorrect number of segments, etc). What's the test plan if we decide to merge this? The main reason the original change was done was to handle OOM conditions and the refactor meant a lot of the logic around mp4s had to be re-tested i.e. short and very long MP4s will need to be tested. Some other things that come to mind:
|
Replace the channel based logic with errgroup, makes it a little simpler and easier to reason about.