Skip to content

simplify agent registration - #3018

Merged
paulwe merged 9 commits into
masterfrom
agents-cleanup
Sep 19, 2024
Merged

paulwe merged 9 commits into
masterfrom
agents-cleanup

Conversation

@paulwe

@paulwe paulwe commented Sep 18, 2024

Copy link
Copy Markdown
Contributor

No description provided.

@paulwe
paulwe requested a review from a team September 18, 2024 07:19
Comment thread pkg/agent/worker.go

var _ WorkerSignalHandler = (*WorkerRegisterer)(nil)

type WorkerRegisterer struct {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

decoupling agent registration from the rest of the message handling allows us to defer choosing how to handle the worker until after we know what types of jobs it can handle. it also allows us to use a simple ws read deadline for registration timeout...

for _, w := range workers {
if _, ok := ignore[w]; !ok && w.Status() == livekit.WorkerStatus_WS_AVAILABLE {
normalizedLoads[w] = normalizeLoad(w.Load())
normalizedLoads[w] = max(0, 1-w.Load())

@josephkieu josephkieu Oct 10, 2024 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This modification might be the cause of the issue we encountered. Can you please check?
livekit/agents#884
from agents, we implemented a load function / threshold that can return the value bigger than 1 for a long time. Recently, we've been encountering a lot of issues related to agents not receiving messages when rooms are created. We suspect this is the cause.

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.

4 participants