livepeer / go-livepeer

Official Go implementation of the Livepeer protocol
http://livepeer.org
MIT License
537 stars 165 forks source link

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

Open leszko opened 4 weeks ago

leszko commented 4 weeks ago

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)

linear[bot] commented 4 weeks ago

ENG-2051 Investigate warnings "No Orchestrators passed max price filter"

codecov[bot] commented 4 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3086/graphs/tree.svg?width=650&height=150&src=pr&token=vKzl2rUYvB&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer)](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3086?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer) ```diff @@ 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](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3086?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer) | Coverage Δ | | |---|---|---| | [server/selection.go](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3086?src=pr&el=tree&filepath=server%2Fselection.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer#diff-c2VydmVyL3NlbGVjdGlvbi5nbw==) | `93.16239% <100.00000%> (+0.05894%)` | :arrow_up: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3086/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer) ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3086?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3086?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer). Last update [3dcdf3d...90c8d2a](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3086?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer). | [Files](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3086?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer) | Coverage Δ | | |---|---|---| | [server/selection.go](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3086?src=pr&el=tree&filepath=server%2Fselection.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer#diff-c2VydmVyL3NlbGVjdGlvbi5nbw==) | `93.16239% <100.00000%> (+0.05894%)` | :arrow_up: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3086/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer)