-
Notifications
You must be signed in to change notification settings - Fork 178
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
Call session end async to avoid unnecessary blocking #2764
Conversation
if err := EndTranscodingSession(ctx, sess); err != nil { | ||
clog.Errorf(ctx, "Error completing transcoding session: %q", err) | ||
} | ||
go func() { |
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.
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.
AFAICT you seem to be right that this call doesn't need to block for B.
Setting to draft until I fix the unit tests |
Codecov Report
@@ Coverage Diff @@
## master #2764 +/- ##
===================================================
- Coverage 56.28293% 56.26956% -0.01337%
===================================================
Files 88 88
Lines 19171 19172 +1
===================================================
- Hits 10790 10788 -2
- Misses 7789 7792 +3
Partials 592 592
Continue to review full report at Codecov.
|
8c17363
to
f85d5c2
Compare
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, except the unit test question, if you want my opinion 👍
goleakOptions := common.IgnoreRoutines() | ||
// allow enough time for the transcode end goroutines to finish | ||
goleakOptions = append(goleakOptions, goleak.MaxSleepInterval(5*time.Second), goleak.MaxRetryAttempts(1000)) | ||
defer goleak.VerifyNone(t, goleakOptions...) |
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.
Why 1000 retry attempts and 5 seconds delay (I believe it's a delay between attempts, not overall)? I think, the EndTranscodingSession
goroutine will finish instantly here. Also maybe pass options to VerifyNone
call directly?
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.
Thanks @cyberj0g. Unfortunately for the tests the communication for the EndTranscodingSession
call isn't set up so it simply times out after the 3 second timeout, so that's the reason for waiting. And the other annoying thing is the goleak library starts off with very small microsecond pauses between retries so that's the reason for the high number.
I've looked into a lot of different ways of abstracting this away for the tests without success, I think it'll have to wait for a later PR.
if err := EndTranscodingSession(ctx, sess); err != nil { | ||
clog.Errorf(ctx, "Error completing transcoding session: %q", err) | ||
} | ||
go func() { |
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.
AFAICT you seem to be right that this call doesn't need to block for B.
@@ -48,7 +48,7 @@ jobs: | |||
uses: actions/cache@v3 | |||
with: | |||
path: /github/home/compiled | |||
key: ${{ runner.os }}-ffmpeg-${{ hashFiles('**/install_ffmpeg.sh') }} | |||
key: ${{ runner.os }}-ffmpeg-${{ hashFiles('install_ffmpeg.sh') }} |
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.
What was the reason for this change?
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.
Builds were failing on master like this: https://github.com/livepeer/go-livepeer/actions/runs/4309780285/jobs/7517555365
It seemed as though the wildcard matching was not working. @hjpotter92 made some changes in this area recently so I'll check with him when he's back but the change I've made has fixed the issue in any case.
What does this pull request do? Explain your changes. (required)
Specific updates (required)
How did you test each of these updates (required)
Ran local B/O/T and verified the session end notifications are working asynchronously.
Does this pull request close any open issues?
#2762
Checklist:
make
runs successfully./test.sh
pass