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

selection: Clear known sessions if none of them has good enough latency score #3086

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

leszko
Copy link
Contributor

@leszko leszko commented Jun 26, 2024

fix https://linear.app/livepeer/issue/ENG-2051/investigate-warnings-no-orchestrators-passed-max-price-filter

Problem: We never cleaned the known sessions, even if all of them had too low latency score to use; example of what sometimes happens:

  1. Broadcaster accumulated 8 known sessions, but all had too low latency score
  2. Session refresh was not triggered because we had a lot of known session in the pool
  3. At the same time, we didn't have sessions in unknown session pool
  4. Selection checked that it cannot use the known session and tried to select from unknown sessions (but the pool was empty or there were no sessions fulfilling the condition of max price or perf score)

…cy score

Problem: We never cleaned the known sessions, even if all of them had too low latency score to use; example of what sometimes happens:
1) Broadcaster accumulated 8 known sessions, but all had too low latency score
2) Session refresh was not triggered because we had a lot of knows session in the pool
3) At the same time, we didn't have sessions in unknown session pool
4) Selection checked that it cannot use the known session and tried to select from unknown sessions (but the pool was empty or there were no sessions fulfilling the condition of max price or perf score)
Copy link

linear bot commented Jun 26, 2024

Copy link

codecov bot commented Jun 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 57.39836%. Comparing base (3dcdf3d) to head (90c8d2a).

Additional details and impacted files

Impacted file tree graph

@@                 Coverage Diff                 @@
##              master       #3086         +/-   ##
===================================================
- Coverage   57.41469%   57.39836%   -0.01633%     
===================================================
  Files             92          92                 
  Lines          15766       15767          +1     
===================================================
- Hits            9052        9050          -2     
- Misses          6111        6114          +3     
  Partials         603         603                 
Files Coverage Δ
server/selection.go 93.16239% <100.00000%> (+0.05894%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3dcdf3d...90c8d2a. Read the comment docs.

Files Coverage Δ
server/selection.go 93.16239% <100.00000%> (+0.05894%) ⬆️

... and 1 file with indirect coverage changes

Copy link
Member

@victorges victorges left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me on the code snippet that was changed, but FTR I'm not super familiar with that entire session management logic.

LGTM

return heap.Pop(s.knownSessions).(*BroadcastSession)
// known session does not have good enough latency score, clear the heap and use unknown session
s.knownSessions = &sessHeap{}
return s.selectUnknownSession(ctx)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this repopulate the known sessions heap as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants