Repository navigation
Implement AgentDispatch service - #2919
Merged
Merged
Conversation
paulwe
approved these changes
Aug 8, 2024
|
|
||
| // This provides utilities attached the agent dispatch to ensure that all pending jobs are created | ||
| // before terminating jobs attached to an agent dispatch. This avoids a race that could cause some pending jobs | ||
| // to not be terninated when a dispatch is deleted. |
| j.lock.Unlock() | ||
| } | ||
|
|
||
| func (j *agentJob) waitForParticipantLeaving(mu *sync.RWMutex) error { |
Contributor
Author
There was a problem hiding this comment.
A leftover from a refactor... I removed it.
| @@ -199,7 +288,7 @@ func NewRoom( | |||
|
|
|||
| r.createAgentDispatchesFromRoomAgent() | |||
Contributor
Author
There was a problem hiding this comment.
We probably want createAgentDispatchesFromRoomAgent to have run by the time NewRoom returns, as its output is needed by the agents lifecycle RPCs. It does very little though (the only potentially blocking call is to storage).
launchRoomAgents could be run in its own goroutine, but it already instantiate goroutines internally do do actual work
| return nil, twirpAuthError(err) | ||
| } | ||
|
|
||
| return ag.agentDispatchClient.CreateDispatch(ctx, rpc.RoomTopic(req.Room), req) |
Contributor
There was a problem hiding this comment.
need an rpc.TopicFormatter in this service (see RoomService) to support cloud topics
| return nil, ErrRoomNotFound | ||
| } | ||
|
|
||
| room.Logger.Debugw("room ListDispatch", "dispatchID", req.DispatchId) |
Contributor
There was a problem hiding this comment.
server rpc logging should already give us these
| err := w.updateJobStatus(update) | ||
|
|
||
| if err != nil { | ||
| w.logger.Infow("received job update for unknown job", "jobId", update.JobId) |
This was referenced Sep 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This allows listing, adding and deleting agent dispatches on an existing room. Requests go to a new AgentDispatchService, which sends them over RPC to the rtc.Room via the RoomManager. The rtc.Room then does agent job management using RPCs to the agent service.