-
Notifications
You must be signed in to change notification settings - Fork 171
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
Fix selection to work also for the transcoding #3188
Conversation
Correct prices for AI jobs are a lot higher and the pools smaller so the risks of somebody gaming the system and slowly draining a Gateway wallet are a lot higher.
As discussed this does work out, thanks for the fix 👍🏻. |
This commit adds tests that ensure that the Capability pricing related functions are working correctly. It also ensures that nil values are handled gracefully.
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.
@leszko, although I verified that this line can be removed, the current logic does not work correctly on the AI side. Here's what happens now:
- The AI sets
minLS
to0
. - When the first request comes in, all sessions are still in the
s.unknownSessions
map, so an unknown session is selected. - The request is completed, and the session is moved to the
s.knownSessions
map with its latency score. - The next request comes in, and it checks the latency score, which is always greater than
0
. As a result, an unknown session is selected again. - The request is completed, and the session is moved to the
s.knownSessions
map with its latency score. - Now, let's assume there are no unknown sessions left. Since the latency score is still greater than
0
, the system will attempt to select an unknown session. However, with no unknown sessions remaining, the Gateway software gets stuck.
The old code worked because it used known sessions as a fallback when no unknown sessions were available.
The old code worked as follows:
|
I thought about it for a while. Let's go back to the logic we had before [1] (so the logic you're currently using for AI). I think this PR [1] is not good. We should not clear know sessions, but rather increase the refreshThreshold [2] (so effectively increase the size of knownSession pool). [1] #3086 go-livepeer/server/broadcast.go Line 39 in aad1a23
|
Changes to make the selection logic in
ai-video
work for transcoding as well (make it compatible with the currentmaster
:0
max price for unused capability:master
)go-livepeer/server/broadcast.go
Line 39 in aad1a23