mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #418] [CLOSED] fix(scheduler): keep round-robin fair when candidates change #419
Labels
No labels
bug
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/AgentENV#419
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/AgentENV/pull/418
Author: @guozy18
Created: 10/22/2026
Status: ❌ Closed
Base:
main← Head:sync/round-robin-fairness📝 Commits (1)
7522262fix: make scheduler round_robin fair across changing candidate sets📊 Changes
2 files changed (+210 additions, -6 deletions)
View changed files
📝
services/scheduler/internal/strategy.go(+56 -4)📝
services/scheduler/internal/strategy_test.go(+154 -2)📄 Description
What
Choose the least-recently-picked node by identity so temporary filtering, rate limits, or candidate reordering do not skew round-robin selection.
Why
The previous counter modulo candidate-count selects by slice position; changing that slice can repeatedly favor the same nodes.
Related issue
N/A — focused correction of existing behavior.
Scope and non-goals
The round-robin implementation and its original regression tests.
Design and behavior changes
Serialize selection with a mutex, remember the last selection time per node, break ties by node ID, and expire entries idle for 24 hours with a sweep limited to once per minute.
Compatibility and operations
Scheduling distribution changes when candidate sets change. No API, configuration, persistence, or host-requirement changes. Ordinary code upgrade/revert.
Validation
This branch is based directly on upstream main
a97473band contains one feature commit with no unmerged PR dependencies.Go checks ran on macOS; Rust checks ran on Linux as a non-root user. The Go subtree is unchanged by the upstream rebase, so the existing Go test, formatting and vet results apply. Full KVM E2E and performance benchmarks were not run.
Risks and reviewer notes
The original scheduler patch, author and author date are preserved. The original message and existing migration co-author trailer are retained. This introduces per-node in-memory bookkeeping; stale entries are reclaimed. No throughput benchmark was run.
Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.