Skip to content

Avoid allocation in client pool slot ordering #536

Description

@leynos

Problem

The 2026-06-05 code-base audit found that client pool slot ordering still allocates and clones slot handles while choosing an acquisition order. This adds noise to a hot path and makes the scheduling intent less direct.

Suggested fix

Replace the per-acquisition ordered Vec construction with direct iteration from the pool's atomic next-slot index. Preserve the current fairness and wrap-around behaviour, but avoid allocating a temporary collection for each acquisition attempt.

Context

Related draft plan: #534

This is intentionally tracked outside the current ExecPlan because the requested pool milestone focuses on duplicated lock recovery, lease dispatch flow, and builder-parts construction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions