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

feat: Replace select() usage with poll() #3010

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pchaseh
Copy link

@pchaseh pchaseh commented Jun 8, 2023

Replaces select() calls with poll() in order to resolve #2994 where the server fails to start if the pipe created by arbiter.py has a file descriptor number past FD_SETSIZE (a limitation of poll()). Tested by running the test app (gunicorn --workers=2 test:app) and verifying that gunicorn's behavior with respect to signal handling was the same as the master branch.

@benoitc benoitc self-assigned this Jul 7, 2023
@benoitc
Copy link
Owner

benoitc commented Nov 18, 2023

select.poll is not supported by some OSs. I suggest to replace hthe usage of select by something more generic like the selectors library.

@benoitc benoitc self-requested a review November 18, 2023 22:20
@benoitc benoitc closed this Feb 15, 2024
@benoitc benoitc reopened this Feb 15, 2024
@benoitc
Copy link
Owner

benoitc commented Feb 15, 2024

the patch looks OK for me. will check it asap.

please don't force push change, it's always better to add a new commit. We figure at the end how to merge :)

Copy link
Owner

@benoitc benoitc left a comment

Choose a reason for hiding this comment

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

please use the selectors library instead if you want to make it portable.

@@ -76,6 +77,8 @@ def __init__(self, app):
0: sys.executable
}

self.poller = select.poll()
Copy link
Owner

Choose a reason for hiding this comment

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

you're still using select?

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.

filedescriptor out of range in select() exception received
2 participants