Skip to content

bpo-44951: Allow setting EPOLLEXCLUSIVE on selectors.EpollSelector #27819

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 1 commit into
base: main
Choose a base branch
from

Conversation

dgilman
Copy link

@dgilman dgilman commented Aug 19, 2021

@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

CLA Missing

Our records indicate the following people have not signed the CLA:

@dgilman

For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@dgilman dgilman changed the title issue44951: Allow setting EPOLLEXCLUSIVE on selectors.EpollSelector bpo-44951: Allow setting EPOLLEXCLUSIVE on selectors.EpollSelector Aug 19, 2021
@@ -349,15 +349,16 @@ def __init__(self):
super().__init__()
self._selector = self._selector_cls()

def register(self, fileobj, events, data=None):
def register(self, fileobj, events, data=None, register_flags=None):
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is in a method literally called register, I'd name the new argument simply flags.

def exclusive(self):
return self._exclusive

def set_exclusive(self, value):
Copy link
Contributor

Choose a reason for hiding this comment

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

So far selectors haven't had this but looking at asyncio, ssl, socket, threading, and multiprocessing code, we usually either use properties for both getting and setting a value, or we use both a get_* and a set_* method.

Since we already have get_key and get_map in selectors.py, and there are no public fields nor properties here, I'd change the exclusive getter to an explicit get_exclusive() method.

@dgilman
Copy link
Author

dgilman commented Sep 11, 2021

Thanks for the feedback - I think it is best to get a decision made on whether this approach is the way to go (modify the Epoll class) or if it should be an entirely new EpollExclusiveSelector class with no API changes.

@dgilman
Copy link
Author

dgilman commented Jul 26, 2022

The latest mailing list post on this issue, summarizing the two approaches and the decision that should be made, is here https://mail.python.org/archives/list/python-dev@python.org/thread/VB2BBUUJENMWPGXGFMON7UQW27ZOBIB7/

@python-cla-bot
Copy link

python-cla-bot bot commented Apr 6, 2025

The following commit authors need to sign the Contributor License Agreement:

CLA signed

@python python deleted a comment Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants