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

server: Set max refresh sessions threshold to 8 #2085

Merged
merged 2 commits into from
Nov 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG_PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

#### Broadcaster

- \#2085 Set max refresh sessions threshold to 8 (@yondonfu)

#### Orchestrator

#### Transcoder
Expand Down
5 changes: 4 additions & 1 deletion server/broadcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ import (
var refreshTimeout = 2500 * time.Millisecond
var maxDurationSec = common.MaxDuration.Seconds()

// Max threshold for # of broadcast sessions under which we will refresh the session list
var maxRefreshSessionsThreshold = 8.0

var Policy *verification.Policy
var BroadcastCfg = &BroadcastConfig{}
var MaxAttempts = 3
Expand Down Expand Up @@ -97,7 +100,7 @@ func (bsm *BroadcastSessionsManager) selectSession() *BroadcastSession {

checkSessions := func(m *BroadcastSessionsManager) bool {
numSess := m.sel.Size()
if numSess < int(math.Ceil(float64(m.numOrchs)/2.0)) {
if numSess < int(math.Min(maxRefreshSessionsThreshold, math.Ceil(float64(m.numOrchs)/2.0))) {
go m.refreshSessions()
}
return (numSess > 0 || bsm.lastSess != nil)
Expand Down