feat(spider-scheduler): Wire the execution manager's resource group from the next-task request down to the dispatch queue. - #471
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughThe request unpacker now returns a named payload with optional resource-group data. The scheduler service and dispatch queue accept this data. Unsupported resource-group retrieval maps to ChangesResource-group task retrieval
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant Client
participant grpc_next_task
participant SchedulerServiceState
participant DispatchQueueReader
Client->>grpc_next_task: Send NextTaskRequest
grpc_next_task->>SchedulerServiceState: Pass request payload
SchedulerServiceState->>DispatchQueueReader: dequeue(resource_group_id, wait_time)
DispatchQueueReader-->>SchedulerServiceState: Assignment or Unsupported
SchedulerServiceState-->>grpc_next_task: Return scheduler result
grpc_next_task-->>Client: Return task response or UNIMPLEMENTED
Suggested reviewers: Merge Risk: ⚪ Minimal · up to No concrete merge-blocking risk remains from the reviewed change. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
An execution manager may be pinned to a resource group, and
NextTaskRequesthas carried an optionalresource_group_idsince #456 — but the scheduler rejected it outright, so a pinned execution manager had no way to say which group's assignments it wanted. This PR carries that field from the wire to the dispatch queue.Nothing serves a pinned request yet. The resource-group-aware core (#470) owns a dispatch queue registry that can, but it does not implement
SchedulerCoreand no configuration selects it, so today every scheduler still runs the single-queue core. What changes here is that the request now reaches the layer where that decision belongs, and the single-queue implementation answers for itself rather than the protocol layer refusing on its behalf.What moves
NextTaskRequest::unpackstops returningCode::Unimplementedforresource_group_idand produces aNextTaskRequestPayloadinstead of a tuple. The gRPC handler destructures it and passes the group throughSchedulerServiceState::next_taskintoDispatchQueueHandle::dequeue, which gains the group as a parameter.The tuple became a struct because the unpacked form reached four fields, two of them
Options: at that width, positional returns stop being readable at the call site and start being a place to swap two arguments of the same type.Checklist
breaking change.
Validation performed
Summary by CodeRabbit
New Features
Bug Fixes