-
Notifications
You must be signed in to change notification settings - Fork 180
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
Add periodic session refresh for Live Video to Video #3404
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3404 +/- ##
===================================================
- Coverage 32.15038% 32.13158% -0.01880%
===================================================
Files 147 147
Lines 40830 40857 +27
===================================================
+ Hits 13127 13128 +1
- Misses 26928 26954 +26
Partials 775 775
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
if err := sel.Refresh(context.Background()); err != nil { | ||
clog.Infof(context.Background(), "Error refreshing AISessionSelector err=%v", err) | ||
} | ||
} |
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.
Should we try to be a good citizen and tear down the loop when the node shuts down?
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.
Hmm, would be good. But I believe it's not so trivial....heheh. I guess we would need to move this to starter.go, etc. Unless you have some simple idea how to exit this loop when the node shuts down?
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.
Yeah, or some chan / signal from LivepeerNode ... not a big deal though if it seems more trouble than it is worth.
Another issue will likely be that ticket params expire in 10 blocks (about 2 minutes). Refreshing the session will add a couple hundred milliseconds on to startup of request. I don't think would overly work Orchestrators to run this every 110 seconds. Also don't think its unreasonable to increase the ticket params expiration to be 10 minutes. I think 10 blocks was from L1 days with larger variations in gas fees. go-livepeer/server/ai_session.go Line 404 in 232df3a
go-livepeer/server/broadcast.go Line 1582 in 232df3a
Also think would be nice to save the LatencyScores at the start of the refresh and add back on to the new sessions. The other PR for the new selector used InitialLatencyScore, where does that come from? |
Very good points @ad-astra-video !
Hmm, let's maybe do something in between:
IIUC the LatencyScores are not changed, because they are used only in |
To reduce the startup, we can periodically refresh sessions, then it won't happen when the stream comes in. This could save us ~1-2s startup time.