Skip to content

feat: move max_executors to limits.#396

Merged
k82cn merged 1 commit into
xflops:mainfrom
k82cn:enhance_limits
Apr 12, 2026
Merged

feat: move max_executors to limits.#396
k82cn merged 1 commit into
xflops:mainfrom
k82cn:enhance_limits

Conversation

@k82cn

@k82cn k82cn commented Apr 12, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: Klaus Ma <klausm@nvidia.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the cluster configuration schema by moving max_executors from the executors block to a centralized limits block and renaming the sessions field to max_sessions. These changes are reflected across configuration files, internal data structures, and tests. Review feedback suggests maintaining backward compatibility for the renamed field using serde aliases and cleaning up the now-obsolete FlameExecutorLimitsYaml structure.

Comment thread common/src/ctx.rs
Comment on lines +80 to +81
pub max_sessions: Option<usize>,
pub max_executors: Option<u32>,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The field sessions has been renamed to max_sessions. To maintain backward compatibility with existing configuration files, consider adding a serde alias so that the old field name is still recognized during deserialization.

    #[serde(alias = "sessions")]
    pub max_sessions: Option<usize>,
    pub max_executors: Option<u32>,

Comment thread common/src/ctx.rs
Comment on lines 387 to 391
fn try_from(executors: FlameExecutorsYaml) -> Result<Self, Self::Error> {
Ok(FlameExecutors {
shim: Shim::try_from(executors.shim.unwrap_or(DEFAULT_SHIM.to_string()))?,
limits: executors
.limits
.map(FlameExecutorLimits::try_from)
.unwrap_or_else(|| Ok(FlameExecutorLimits::default()))?,
})
}
}

impl TryFrom<FlameExecutorLimitsYaml> for FlameExecutorLimits {
type Error = FlameError;
fn try_from(limits: FlameExecutorLimitsYaml) -> Result<Self, Self::Error> {
Ok(FlameExecutorLimits {
max_executors: limits
.max_executors
.unwrap_or(DEFAULT_MAX_EXECUTORS_PER_NODE),
})
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

With max_executors moved to the limits block, the limits field in FlameExecutorsYaml and the FlameExecutorLimitsYaml struct are no longer used in the TryFrom implementation. These should be removed from the FlameExecutorsYaml definition to clean up the schema and avoid confusion.

@k82cn k82cn merged commit 08b5587 into xflops:main Apr 12, 2026
6 checks passed
@k82cn k82cn deleted the enhance_limits branch April 12, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant