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

Merged
merged 3 commits into from
Sep 10, 2024

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.38346%. Comparing base (45652c4) to head (97bf818).
Report is 1 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@                 Coverage Diff                 @@
##              master       #3086         +/-   ##
===================================================
+ Coverage   57.38077%   57.38346%   +0.00269%     
===================================================
  Files             92          92                 
  Lines          15852       15853          +1     
===================================================
+ Hits            9096        9097          +1     
  Misses          6147        6147                 
  Partials         609         609                 
Files with missing lines Coverage Δ
server/selection.go 93.16239% <100.00000%> (+0.05894%) ⬆️

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 45652c4...97bf818. Read the comment docs.

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

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

server/selection.go Show resolved Hide resolved
@leszko leszko merged commit 834a9c6 into master Sep 10, 2024
18 checks passed
@leszko leszko deleted the rafal/fix-leaked-known-sessions branch September 10, 2024 13:47
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.

3 participants