-
Notifications
You must be signed in to change notification settings - Fork 179
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -682,9 +682,11 @@ func (bsm *BroadcastSessionsManager) collectResults(submitResultsCh chan *Submit | |
// the caller needs to ensure bsm.sessLock is acquired before calling this. | ||
func (bsm *BroadcastSessionsManager) completeSessionUnsafe(ctx context.Context, sess *BroadcastSession, tearDown bool) { | ||
if tearDown { | ||
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 commentThe 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 commentThe 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. |
||
if err := EndTranscodingSession(ctx, sess); err != nil { | ||
clog.Errorf(ctx, "Error completing transcoding session: %q", err) | ||
} | ||
}() | ||
} | ||
if sess.OrchestratorScore == common.Score_Untrusted { | ||
bsm.untrustedPool.completeSession(sess) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,16 +31,13 @@ import ( | |
ffmpeg "github.com/livepeer/lpms/ffmpeg" | ||
"github.com/livepeer/lpms/segmenter" | ||
"github.com/livepeer/lpms/stream" | ||
"go.uber.org/goleak" | ||
) | ||
|
||
// var S *LivepeerServer | ||
|
||
var pushResetWg sync.WaitGroup // needed to synchronize exits from HTTP push | ||
|
||
// func setupServer() *LivepeerServer { | ||
// s, _ := setupServerWithCancel() | ||
// return s | ||
// } | ||
var port = 10000 | ||
|
||
// waitForTCP tries to establish TCP connection for a specified time | ||
|
@@ -1226,6 +1223,10 @@ func TestRegisterConnection(t *testing.T) { | |
} | ||
|
||
func TestBroadcastSessionManagerWithStreamStartStop(t *testing.T) { | ||
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 commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @cyberj0g. Unfortunately for the tests the communication for the |
||
assert := assert.New(t) | ||
|
||
s, cancel := setupServerWithCancel() | ||
|
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.