Skip to content

ValueError: filedescriptor out of range in select() #68136

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

Open
wants to merge 2 commits into
base: 3007.x
Choose a base branch
from

Conversation

julianofischer
Copy link

@julianofischer julianofischer commented Jun 30, 2025

What does this PR do?

This PR replaces the use of select.select() in the recv() method with the higher-level selectors API (selectors.DefaultSelector), eliminating the fixed FD_SETSIZE limit. Specifically, when timeout == 0, it now:

Registers the socket for read events on a DefaultSelector

Calls selector.select(timeout=0) instead of select.select([...], [], [], 0)

Processes any ready file descriptors directly from the selector results

By using selectors, the code automatically leverages the best available backend (epoll, kqueue, poll, etc.) and lifts the file-descriptor range restriction, preventing the “filedescriptor out of range in select()” errors on systems with high FD numbers.

What issues does this PR fix or reference?

#65878
#63404

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

Yes/No

@julianofischer julianofischer requested a review from a team as a code owner June 30, 2025 23:26
Copy link

welcome bot commented Jun 30, 2025

Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
Please be sure to review our Code of Conduct. Also, check out some of our community resources including:

There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar.
If you have additional questions, email us at saltproject.pdl@broadcom.com. We’re glad you’ve joined our community and look forward to doing awesome things with you!

@twangboy twangboy added this to the Argon v3008.0 milestone Jul 1, 2025
Copy link
Contributor

@twangboy twangboy left a comment

Choose a reason for hiding this comment

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

Could we get a changelog and a test for this change?

@julianofischer julianofischer changed the base branch from master to 3007.x August 8, 2025 23:02
@julianofischer julianofischer changed the base branch from 3007.x to master August 8, 2025 23:04
@julianofischer julianofischer force-pushed the fix-for-filedescriptor-out-of-range-in-tcp branch from 5ba7e58 to 3bf52b0 Compare August 8, 2025 23:19
@julianofischer julianofischer changed the base branch from master to 3007.x August 8, 2025 23:20
@twangboy twangboy added the test:full Run the full test suite label Aug 12, 2025
@julianofischer julianofischer requested a review from dwoz August 16, 2025 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test:full Run the full test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants