-
Notifications
You must be signed in to change notification settings - Fork 177
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
core: Return from transcode loop if seg chan closed #2591
Conversation
407fa45
to
101e96a
Compare
Codecov Report
@@ Coverage Diff @@
## master #2591 +/- ##
===================================================
+ Coverage 56.44854% 56.45315% +0.00460%
===================================================
Files 88 88
Lines 18888 18890 +2
===================================================
+ Hits 10662 10664 +2
Misses 7648 7648
Partials 578 578
Continue to review full report at Codecov.
|
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.
😱 how did I miss that. Wonder if some static analysis tool would catch such errors. We definitely need to review PRs with concurrency more thoroughly as well.
Edit: found an existing issue, related to linting #1801
I think looking into starting to use some static analysis tooling to catch bugs such as missing context cancellations is a good idea. Adding test cases for resource cleanup for changes that could affect goroutine management should help as well (i.e. the one added in this PR would've caught the bug). |
What does this pull request do? Explain your changes. (required)
This PR updates the transcode loop to exit the loop if the segment channel is closed.
a1fb761 introduced the possibility of the segment channel being closed via a EndTranscodingSession RPC call. When that happens, the bug described in this comment can occur.
Specific updates (required)
See commit history.
45bf1e1 contains a small update to avoid logging a nil error if there was no error when B calls EndTranscodingSession.
How did you test each of these updates (required)
master
kill -ABRT <PID>
where<PID>
was the process ID for O to dump a stack trace of goroutinescore.transcodeSegmentLoop()
goroutine which indicates that the goroutine was not cleaned up properly after the transcoding session was endedcore.transcodeSegmentLoop()
goroutines which indiciates that the goroutine was cleaned up properly after the transcoding session was endedDoes this pull request close any open issues?
Fixes #2589
Checklist:
make
runs successfully./test.sh
pass