fix(priority): correct session desired#436
Conversation
jinzhejz
commented
May 7, 2026
- Cap Σ ssn_desired ≤ cluster total_slots inside PriorityPlugin.setup
- Sort open sessions by (priority desc, creation_time asc) before distribution
- Greedy single-pass grant: ssn_desired = min(compute_demand, remaining)
- ssn_allocated runtime update via lifecycle callbacks unchanged
There was a problem hiding this comment.
Code Review
This pull request implements priority-aware resource distribution within the PriorityPlugin. The core change involves calculating the total available cluster slots during the setup() phase and distributing them among open sessions based on priority (descending) and creation time (ascending) as a tiebreaker. This logic populates a new ssn_desired map, which is_underused now consults to ensure high-priority sessions are prioritized for resource allocation until their calculated share is met. By moving the cluster-capacity cap into the PriorityPlugin, the implementation prevents the aggregate over-allocation issues previously seen in the FairShare plugin. Feedback from the review pointed out a minor typo in the design documentation.
39e29ab to
4ad3a55
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
4ad3a55 to
dfc9a9c
Compare