Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.0: Bound default value for thread pool args (backport of #2599) #2662

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Aug 19, 2024

Problem

The thread pool argument trait declares min/max/default functions. These functions are then called to provide a default as well as validation that any user set value on the CLI is within [min(), max()].

Some of the default values are fixed numbers. On a machine with few enough cores, the default could exceed the max. This would raise an error when the argument is parsed. This can be worked around by the user specifying a lower value; however, these flags are still very much experimental and intentionally hidden.

Summary of Changes

So, make the default value that is passed to CLAP the min of default() and max(). This will adjust the default on low core count machines while leaving settings on sufficient machines untouched.

Fixes #2103


This is an automatic backport of pull request #2599 done by [Mergify](https://mergify.com).

@mergify mergify bot requested a review from a team as a code owner August 19, 2024 19:36
The thread pool argument trait declares min/max/default functions. These
functions are then called to provide a default as well as validation
that any user set value on the CLI is within [min(), max()].

Some of the default values are fixed numbers. On a machine with few
enough cores, the default could exceed the max. This would raise an
error when the argument is parsed. This can be worked around by the user
specifying a lower value; however, these flags are still very much
experimental and intentionally hidden.

So, make the default value that is passed to CLAP the min of default()
and max(). This will adjust the default on low core count machines while
leaving settings on sufficient machines untouched.

(cherry picked from commit 094a634)
@steviez
Copy link

steviez commented Aug 19, 2024

Basically as the problem description states - there was an issue for corner case (low core machine) that this PR addresses. It is a small change and present in v2.0, so I think we should BP

Copy link

@bw-solana bw-solana left a comment

Choose a reason for hiding this comment

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

LGTM

@steviez steviez merged commit f3b569b into v2.0 Aug 21, 2024
38 checks passed
@steviez steviez deleted the mergify/bp/v2.0/pr-2599 branch August 21, 2024 16:59
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.

3 participants